diff --git a/.gitignore b/.gitignore index eb5a9e709..a1b612afb 100644 --- a/.gitignore +++ b/.gitignore @@ -196,3 +196,7 @@ FakesAssemblies/ *.opt /Build.mono /Build.windows + + +src/Jackett.Web/jspm_packages +src/Jackett.Web/npm_packages \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..a1c3751a4 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/Jackett/autodl-trackers"] + path = src/Jackett/autodl-trackers + url = https://github.com/autodl-community/autodl-trackers.git diff --git a/README.md b/README.md index a659c27f5..e93f13f75 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ We were previously focused on TV but are working on extending searches to allow * [ShowRSS](https://showrss.info/) * [Strike](https://getstrike.net/) * [T411](http://www.t411.io/) + * [TehConnection](https://tehconnection.eu/) * [The Pirate Bay](https://thepiratebay.se/) * [TorrentBytes](https://www.torrentbytes.net/) * [TorrentDay](https://torrentday.eu/) diff --git a/src/Jackett.Console/App.config b/src/Jackett.Console/App.config index b73353b33..68e288c8e 100644 --- a/src/Jackett.Console/App.config +++ b/src/Jackett.Console/App.config @@ -1,38 +1,54 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Jackett.Console/Jackett.Console.csproj b/src/Jackett.Console/Jackett.Console.csproj index 5799b313e..1ab1915c5 100644 --- a/src/Jackett.Console/Jackett.Console.csproj +++ b/src/Jackett.Console/Jackett.Console.csproj @@ -1,180 +1,181 @@ - - - - - Debug - AnyCPU - {4E2A81DA-E235-4A88-AD20-38AABBFBF33C} - Exe - Properties - Jackett.Console - JackettConsole - v4.5 - 512 - true - - - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - jackett.ico - - - JackettConsole.Program - - - - ..\packages\Autofac.3.5.2\lib\net40\Autofac.dll - True - - - ..\packages\Autofac.Owin.3.1.0\lib\net45\Autofac.Integration.Owin.dll - True - - - ..\packages\Autofac.WebApi2.3.4.0\lib\net45\Autofac.Integration.WebApi.dll - True - - - ..\packages\Autofac.WebApi2.Owin.3.2.0\lib\net45\Autofac.Integration.WebApi.Owin.dll - True - - - ..\packages\AutoMapper.4.0.4\lib\net45\AutoMapper.dll - True - - - ..\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll - True - - - ..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll - True - - - ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll - True - - - ..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll - True - - - ..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll - True - - - ..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll - True - - - ..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll - True - - - ..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll - True - - - ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll - True - - - ..\packages\NLog.4.0.1\lib\net45\NLog.dll - True - - - ..\packages\Owin.1.0\lib\net40\Owin.dll - True - - - - - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - True - - - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll - True - - - - ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.Tracing.5.2.3\lib\net45\System.Web.Http.Tracing.dll - True - - - - - - - - - - - - - - - - - - - - {74420a79-cc16-442c-8b1e-7c1b913844f0} - CurlSharp - - - {e636d5f8-68b4-4903-b4ed-ccfd9c9e899f} - Jackett - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + + Debug + AnyCPU + {4E2A81DA-E235-4A88-AD20-38AABBFBF33C} + Exe + Properties + Jackett.Console + JackettConsole + v4.5 + 512 + true + + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + jackett.ico + + + JackettConsole.Program + + + + ..\packages\Autofac.3.5.2\lib\net40\Autofac.dll + True + + + ..\packages\Autofac.Owin.3.1.0\lib\net45\Autofac.Integration.Owin.dll + True + + + ..\packages\Autofac.WebApi2.3.4.0\lib\net45\Autofac.Integration.WebApi.dll + True + + + ..\packages\Autofac.WebApi2.Owin.3.2.0\lib\net45\Autofac.Integration.WebApi.Owin.dll + True + + + ..\packages\AutoMapper.4.0.4\lib\net45\AutoMapper.dll + True + + + ..\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll + True + + + ..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll + True + + + ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll + True + + + ..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll + True + + + ..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll + True + + + ..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll + True + + + ..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll + True + + + ..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll + True + + + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll + True + + + ..\packages\NLog.4.1.0\lib\net45\NLog.dll + + + ..\packages\Owin.1.0\lib\net40\Owin.dll + True + + + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll + True + + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Tracing.5.2.3\lib\net45\System.Web.Http.Tracing.dll + True + + + + + + + + + + + + + + + + Designer + + + + + + {74420a79-cc16-442c-8b1e-7c1b913844f0} + CurlSharp + + + {e636d5f8-68b4-4903-b4ed-ccfd9c9e899f} + Jackett + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + --> \ No newline at end of file diff --git a/src/Jackett.Console/Program.cs b/src/Jackett.Console/Program.cs index f83d4ed14..b0310346b 100644 --- a/src/Jackett.Console/Program.cs +++ b/src/Jackett.Console/Program.cs @@ -1,212 +1,213 @@ -using CommandLine; -using CommandLine.Text; -using Jackett; -using Jackett.Console; -using Jackett.Indexers; -using Jackett.Utils; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading; -using System.Threading.Tasks; - -namespace JackettConsole -{ - public class Program - { - static void Main(string[] args) - { - try - { - var options = new ConsoleOptions(); - if (!Parser.Default.ParseArguments(args, options) || options.ShowHelp == true) - { - if (options.LastParserState != null && options.LastParserState.Errors.Count > 0) - { - var help = new HelpText(); - var errors = help.RenderParsingErrorsText(options, 2); // indent with two spaces - Console.WriteLine("Jackett v" + Engine.ConfigService.GetVersion()); - Console.WriteLine("Switch error: " + errors); - Console.WriteLine("See --help for further details on switches."); - Environment.ExitCode = 1; - return; - } - else - { - - var text = HelpText.AutoBuild(options, (HelpText current) => HelpText.DefaultParsingErrorsHandler(options, current)); - text.Copyright = " "; - text.Heading = "Jackett v" + Engine.ConfigService.GetVersion() + " options:"; - Console.WriteLine(text); - Environment.ExitCode = 1; - return; - } - } - else - { - - if (options.ListenPublic && options.ListenPrivate) - { - Console.WriteLine("You can only use listen private OR listen publicly."); - Environment.ExitCode = 1; - return; - } - /* ====== Options ===== */ - - // SSL Fix - Startup.DoSSLFix = options.SSLFix; - - // Use curl - if (options.Client != null) - Startup.ClientOverride = options.Client.ToLowerInvariant(); - - // Logging - if (options.Logging) - Startup.LogRequests = true; - - // Tracing - if (options.Tracing) - Startup.TracingEnabled = true; - - // Log after the fact as using the logger will cause the options above to be used - - if (options.Logging) - Engine.Logger.Info("Logging enabled."); - - if (options.Tracing) - Engine.Logger.Info("Tracing enabled."); - - if (options.SSLFix == true) - Engine.Logger.Info("SSL ECC workaround enabled."); - else if (options.SSLFix == false) - Engine.Logger.Info("SSL ECC workaround has been disabled."); - /* ====== Actions ===== */ - - // Install service - if (options.Install) - { - Engine.ServiceConfig.Install(); - return; - } - - // Uninstall service - if (options.Uninstall) - { - Engine.Server.ReserveUrls(doInstall: false); - Engine.ServiceConfig.Uninstall(); - return; - } - - // Reserve urls - if (options.ReserveUrls) - { - Engine.Server.ReserveUrls(doInstall: true); - return; - } - - // Start Service - if (options.StartService) - { - if (!Engine.ServiceConfig.ServiceRunning()) - { - Engine.ServiceConfig.Start(); - } - return; - } - - // Stop Service - if (options.StopService) - { - if (Engine.ServiceConfig.ServiceRunning()) - { - Engine.ServiceConfig.Stop(); - } - return; - } - - // Migrate settings - if (options.MigrateSettings) - { - Engine.ConfigService.PerformMigration(); - return; - } - - - // Show Version - if (options.ShowVersion) - { - Console.WriteLine("Jackett v" + Engine.ConfigService.GetVersion()); - return; - } - - /* ====== Overrides ===== */ - - // Override listen public - if (options.ListenPublic || options.ListenPrivate) - { - if (Engine.Server.Config.AllowExternal != options.ListenPublic) - { - Engine.Logger.Info("Overriding external access to " + options.ListenPublic); - Engine.Server.Config.AllowExternal = options.ListenPublic; - if (System.Environment.OSVersion.Platform != PlatformID.Unix) - { - if (ServerUtil.IsUserAdministrator()) - { - Engine.Server.ReserveUrls(doInstall: true); - } - else - { - Engine.Logger.Error("Unable to switch to public listening without admin rights."); - Environment.ExitCode = 1; - return; - } - } - - Engine.Server.SaveConfig(); - } - } - - // Override port - if (options.Port != 0) - { - if (Engine.Server.Config.Port != options.Port) - { - Engine.Logger.Info("Overriding port to " + options.Port); - Engine.Server.Config.Port = options.Port; - if (System.Environment.OSVersion.Platform != PlatformID.Unix) - { - if (ServerUtil.IsUserAdministrator()) - { - Engine.Server.ReserveUrls(doInstall: true); - } - else - { - Engine.Logger.Error("Unable to switch ports when not running as administrator"); - Environment.ExitCode = 1; - return; - } - } - - Engine.Server.SaveConfig(); - } - } - } - - Engine.Server.Initalize(); - Engine.Server.Start(); - Engine.RunTime.Spin(); - Engine.Logger.Info("Server thread exit"); - } - catch (Exception e) - { - Engine.Logger.Error(e, "Top level exception"); - } - } - } -} - +using CommandLine; +using CommandLine.Text; +using Jackett; +using Jackett.Console; +using Jackett.Indexers; +using Jackett.Services; +using Jackett.Utils; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; + +namespace JackettConsole +{ + public class Program + { + static void Main(string[] args) + { + try + { + var options = new ConsoleOptions(); + if (!Parser.Default.ParseArguments(args, options) || options.ShowHelp == true) + { + if (options.LastParserState != null && options.LastParserState.Errors.Count > 0) + { + var help = new HelpText(); + var errors = help.RenderParsingErrorsText(options, 2); // indent with two spaces + Console.WriteLine("Jackett v" + Engine.ConfigService.GetVersion()); + Console.WriteLine("Switch error: " + errors); + Console.WriteLine("See --help for further details on switches."); + Environment.ExitCode = 1; + return; + } + else + { + + var text = HelpText.AutoBuild(options, (HelpText current) => HelpText.DefaultParsingErrorsHandler(options, current)); + text.Copyright = " "; + text.Heading = "Jackett v" + Engine.ConfigService.GetVersion() + " options:"; + Console.WriteLine(text); + Environment.ExitCode = 1; + return; + } + } + else + { + + if (options.ListenPublic && options.ListenPrivate) + { + Console.WriteLine("You can only use listen private OR listen publicly."); + Environment.ExitCode = 1; + return; + } + /* ====== Options ===== */ + + // SSL Fix + Startup.DoSSLFix = options.SSLFix; + + // Use curl + if (options.Client != null) + Startup.ClientOverride = options.Client.ToLowerInvariant(); + + // Logging + if (options.Logging) + Startup.LogRequests = true; + + // Tracing + if (options.Tracing) + Startup.TracingEnabled = true; + + // Log after the fact as using the logger will cause the options above to be used + + if (options.Logging) + Engine.Logger.Info("Logging enabled."); + + if (options.Tracing) + Engine.Logger.Info("Tracing enabled."); + + if (options.SSLFix == true) + Engine.Logger.Info("SSL ECC workaround enabled."); + else if (options.SSLFix == false) + Engine.Logger.Info("SSL ECC workaround has been disabled."); + /* ====== Actions ===== */ + + // Install service + if (options.Install) + { + Engine.ServiceConfig.Install(); + return; + } + + // Uninstall service + if (options.Uninstall) + { + Engine.Server.ReserveUrls(doInstall: false); + Engine.ServiceConfig.Uninstall(); + return; + } + + // Reserve urls + if (options.ReserveUrls) + { + Engine.Server.ReserveUrls(doInstall: true); + return; + } + + // Start Service + if (options.StartService) + { + if (!Engine.ServiceConfig.ServiceRunning()) + { + Engine.ServiceConfig.Start(); + } + return; + } + + // Stop Service + if (options.StopService) + { + if (Engine.ServiceConfig.ServiceRunning()) + { + Engine.ServiceConfig.Stop(); + } + return; + } + + // Migrate settings + if (options.MigrateSettings) + { + Engine.ConfigService.PerformMigration(); + return; + } + + + // Show Version + if (options.ShowVersion) + { + Console.WriteLine("Jackett v" + Engine.ConfigService.GetVersion()); + return; + } + + /* ====== Overrides ===== */ + + // Override listen public + if (options.ListenPublic || options.ListenPrivate) + { + if (Engine.Server.Config.AllowExternal != options.ListenPublic) + { + Engine.Logger.Info("Overriding external access to " + options.ListenPublic); + Engine.Server.Config.AllowExternal = options.ListenPublic; + if (System.Environment.OSVersion.Platform != PlatformID.Unix) + { + if (ServerUtil.IsUserAdministrator()) + { + Engine.Server.ReserveUrls(doInstall: true); + } + else + { + Engine.Logger.Error("Unable to switch to public listening without admin rights."); + Environment.ExitCode = 1; + return; + } + } + + Engine.Server.SaveConfig(); + } + } + + // Override port + if (options.Port != 0) + { + if (Engine.Server.Config.Port != options.Port) + { + Engine.Logger.Info("Overriding port to " + options.Port); + Engine.Server.Config.Port = options.Port; + if (System.Environment.OSVersion.Platform != PlatformID.Unix) + { + if (ServerUtil.IsUserAdministrator()) + { + Engine.Server.ReserveUrls(doInstall: true); + } + else + { + Engine.Logger.Error("Unable to switch ports when not running as administrator"); + Environment.ExitCode = 1; + return; + } + } + + Engine.Server.SaveConfig(); + } + } + } + + Engine.Server.Initalize(); + Engine.Server.Start(); + Engine.RunTime.Spin(); + Engine.Logger.Info("Server thread exit"); + } + catch (Exception e) + { + Engine.Logger.Error(e, "Top level exception"); + } + } + } +} + diff --git a/src/Jackett.Console/packages.config b/src/Jackett.Console/packages.config index e6bd5092a..23cf2946e 100644 --- a/src/Jackett.Console/packages.config +++ b/src/Jackett.Console/packages.config @@ -1,27 +1,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Jackett.Service/App.config b/src/Jackett.Service/App.config index ac8dbeb66..a67b52413 100644 --- a/src/Jackett.Service/App.config +++ b/src/Jackett.Service/App.config @@ -1,30 +1,50 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Jackett.Service/Jackett.Service.csproj b/src/Jackett.Service/Jackett.Service.csproj index 214be7877..1e7091258 100644 --- a/src/Jackett.Service/Jackett.Service.csproj +++ b/src/Jackett.Service/Jackett.Service.csproj @@ -1,167 +1,167 @@ - - - - - Debug - AnyCPU - {BF611F7B-4658-4CB8-AA9E-0736FADAA3BA} - WinExe - Properties - Jackett.Service - JackettService - v4.5 - 512 - true - - - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - jackett.ico - - - - ..\packages\Autofac.3.5.2\lib\net40\Autofac.dll - True - - - ..\packages\Autofac.Owin.3.1.0\lib\net45\Autofac.Integration.Owin.dll - True - - - ..\packages\Autofac.WebApi2.3.4.0\lib\net45\Autofac.Integration.WebApi.dll - True - - - ..\packages\Autofac.WebApi2.Owin.3.2.0\lib\net45\Autofac.Integration.WebApi.Owin.dll - True - - - ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll - True - - - ..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll - True - - - ..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll - True - - - ..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll - True - - - ..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll - True - - - ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll - True - - - ..\packages\NLog.4.0.1\lib\net45\NLog.dll - True - - - ..\packages\Owin.1.0\lib\net40\Owin.dll - True - - - - - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - True - - - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll - True - - - - ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.Tracing.5.2.3\lib\net45\System.Web.Http.Tracing.dll - True - - - - - - - - - - - - Component - - - Service.cs - - - - - - - - - - - - - - {74420a79-cc16-442c-8b1e-7c1b913844f0} - CurlSharp - - - {e636d5f8-68b4-4903-b4ed-ccfd9c9e899f} - Jackett - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + + Debug + AnyCPU + {BF611F7B-4658-4CB8-AA9E-0736FADAA3BA} + WinExe + Properties + Jackett.Service + JackettService + v4.5 + 512 + true + + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + jackett.ico + + + + ..\packages\Autofac.3.5.2\lib\net40\Autofac.dll + True + + + ..\packages\Autofac.Owin.3.1.0\lib\net45\Autofac.Integration.Owin.dll + True + + + ..\packages\Autofac.WebApi2.3.4.0\lib\net45\Autofac.Integration.WebApi.dll + True + + + ..\packages\Autofac.WebApi2.Owin.3.2.0\lib\net45\Autofac.Integration.WebApi.Owin.dll + True + + + ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll + True + + + ..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll + True + + + ..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll + True + + + ..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll + True + + + ..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll + True + + + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll + True + + + ..\packages\NLog.4.1.0\lib\net45\NLog.dll + True + + + ..\packages\Owin.1.0\lib\net40\Owin.dll + True + + + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll + True + + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Tracing.5.2.3\lib\net45\System.Web.Http.Tracing.dll + True + + + + + + + + + + + + Component + + + Service.cs + + + + + + + + + + + + + + {74420a79-cc16-442c-8b1e-7c1b913844f0} + CurlSharp + + + {e636d5f8-68b4-4903-b4ed-ccfd9c9e899f} + Jackett + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + --> \ No newline at end of file diff --git a/src/Jackett.Service/packages.config b/src/Jackett.Service/packages.config index eb26439ff..96cef8127 100644 --- a/src/Jackett.Service/packages.config +++ b/src/Jackett.Service/packages.config @@ -1,23 +1,23 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Jackett.Test/Jackett.Test.csproj b/src/Jackett.Test/Jackett.Test.csproj index 08d275e16..6c7a82e24 100644 --- a/src/Jackett.Test/Jackett.Test.csproj +++ b/src/Jackett.Test/Jackett.Test.csproj @@ -1,222 +1,219 @@ - - - - Debug - AnyCPU - {E75D4F15-5DA3-4332-ADB1-28FB673DAE56} - Library - Properties - JackettTest - JackettTest - v4.5 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\Autofac.3.5.2\lib\net40\Autofac.dll - True - - - ..\packages\Autofac.Owin.3.1.0\lib\net45\Autofac.Integration.Owin.dll - True - - - ..\packages\Autofac.WebApi2.3.4.0\lib\net45\Autofac.Integration.WebApi.dll - True - - - ..\packages\Autofac.WebApi2.Owin.3.2.0\lib\net45\Autofac.Integration.WebApi.Owin.dll - True - - - ..\packages\AutoMapper.4.0.4\lib\net45\AutoMapper.dll - True - - - ..\packages\CsQuery.1.3.4\lib\net40\CsQuery.dll - True - - - ..\packages\FluentAssertions.3.5.0\lib\net45\FluentAssertions.dll - True - - - ..\packages\FluentAssertions.3.5.0\lib\net45\FluentAssertions.Core.dll - True - - - ..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll - True - - - - ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll - True - - - ..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll - True - - - ..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll - True - - - ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll - True - - - ..\packages\NLog.4.0.1\lib\net45\NLog.dll - True - - - ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll - True - - - ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.interfaces.dll - True - - - ..\packages\NUnit.2.6.4\lib\nunit.framework.dll - True - - - ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.util.dll - True - - - ..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll - True - - - ..\packages\Owin.1.0\lib\net40\Owin.dll - True - - - - - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - True - - - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll - True - - - - ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - - - - {e636d5f8-68b4-4903-b4ed-ccfd9c9e899f} - Jackett - - - - - - - - - - - - - False - - - False - - - False - - - False - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + Debug + AnyCPU + {E75D4F15-5DA3-4332-ADB1-28FB673DAE56} + Library + Properties + JackettTest + JackettTest + v4.5 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Autofac.3.5.2\lib\net40\Autofac.dll + True + + + ..\packages\Autofac.Owin.3.1.0\lib\net45\Autofac.Integration.Owin.dll + True + + + ..\packages\Autofac.WebApi2.3.4.0\lib\net45\Autofac.Integration.WebApi.dll + True + + + ..\packages\Autofac.WebApi2.Owin.3.2.0\lib\net45\Autofac.Integration.WebApi.Owin.dll + True + + + ..\packages\AutoMapper.4.0.4\lib\net45\AutoMapper.dll + True + + + ..\packages\CsQuery.1.3.4\lib\net40\CsQuery.dll + True + + + ..\packages\FluentAssertions.4.0.0\lib\net45\FluentAssertions.dll + + + ..\packages\FluentAssertions.4.0.0\lib\net45\FluentAssertions.Core.dll + + + ..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll + True + + + + ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll + True + + + ..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll + True + + + ..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll + True + + + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll + True + + + ..\packages\NLog.4.1.0\lib\net45\NLog.dll + + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll + True + + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.interfaces.dll + True + + + ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + ..\packages\NUnitTestAdapter.2.0.0\lib\nunit.util.dll + True + + + ..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll + True + + + ..\packages\Owin.1.0\lib\net40\Owin.dll + True + + + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll + True + + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + + + + {e636d5f8-68b4-4903-b4ed-ccfd9c9e899f} + Jackett + + + + + + + + + + + + + False + + + False + + + False + + + False + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + --> \ No newline at end of file diff --git a/src/Jackett.Test/app.config b/src/Jackett.Test/app.config index c88a03853..46f3ba781 100644 --- a/src/Jackett.Test/app.config +++ b/src/Jackett.Test/app.config @@ -1,31 +1,51 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Jackett.Test/packages.config b/src/Jackett.Test/packages.config index 853537bb9..380db31b0 100644 --- a/src/Jackett.Test/packages.config +++ b/src/Jackett.Test/packages.config @@ -1,26 +1,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Jackett.Tray/App.config b/src/Jackett.Tray/App.config index 2b55dff29..7c2eccc9f 100644 --- a/src/Jackett.Tray/App.config +++ b/src/Jackett.Tray/App.config @@ -1,34 +1,54 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Jackett.Tray/Jackett.Tray.csproj b/src/Jackett.Tray/Jackett.Tray.csproj index 1340d0257..fe016b061 100644 --- a/src/Jackett.Tray/Jackett.Tray.csproj +++ b/src/Jackett.Tray/Jackett.Tray.csproj @@ -1,204 +1,203 @@ - - - - - Debug - AnyCPU - {FF9025B1-EC14-4AA9-8081-9F69C5E35B63} - WinExe - Properties - Jackett.Tray - JackettTray - v4.5 - 512 - true - - - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - jackett.ico - - - - ..\packages\Autofac.3.5.2\lib\net40\Autofac.dll - True - - - ..\packages\Autofac.Owin.3.1.0\lib\net45\Autofac.Integration.Owin.dll - True - - - ..\packages\Autofac.WebApi2.3.4.0\lib\net45\Autofac.Integration.WebApi.dll - True - - - ..\packages\Autofac.WebApi2.Owin.3.2.0\lib\net45\Autofac.Integration.WebApi.Owin.dll - True - - - ..\packages\AutoMapper.4.0.4\lib\net45\AutoMapper.dll - True - - - ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll - True - - - ..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll - True - - - ..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll - True - - - ..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll - True - - - ..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll - True - - - ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll - True - - - ..\packages\NLog.4.0.1\lib\net45\NLog.dll - True - - - ..\packages\Owin.1.0\lib\net40\Owin.dll - True - - - - - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - True - - - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll - True - - - - ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.Tracing.5.2.3\lib\net45\System.Web.Http.Tracing.dll - True - - - - - - - - - - - - - - Form - - - Main.cs - - - - - Main.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - Designer - - - - - - - - {e636d5f8-68b4-4903-b4ed-ccfd9c9e899f} - Jackett - - - - - {F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} - 1 - 0 - 0 - tlbimp - False - True - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + + Debug + AnyCPU + {FF9025B1-EC14-4AA9-8081-9F69C5E35B63} + WinExe + Properties + Jackett.Tray + JackettTray + v4.5 + 512 + true + + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + jackett.ico + + + + ..\packages\Autofac.3.5.2\lib\net40\Autofac.dll + True + + + ..\packages\Autofac.Owin.3.1.0\lib\net45\Autofac.Integration.Owin.dll + True + + + ..\packages\Autofac.WebApi2.3.4.0\lib\net45\Autofac.Integration.WebApi.dll + True + + + ..\packages\Autofac.WebApi2.Owin.3.2.0\lib\net45\Autofac.Integration.WebApi.Owin.dll + True + + + ..\packages\AutoMapper.4.0.4\lib\net45\AutoMapper.dll + True + + + ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll + True + + + ..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll + True + + + ..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll + True + + + ..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll + True + + + ..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll + True + + + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll + True + + + ..\packages\NLog.4.1.0\lib\net45\NLog.dll + + + ..\packages\Owin.1.0\lib\net40\Owin.dll + True + + + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll + True + + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Tracing.5.2.3\lib\net45\System.Web.Http.Tracing.dll + True + + + + + + + + + + + + + + Form + + + Main.cs + + + + + Main.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + Designer + + + + + + + + {e636d5f8-68b4-4903-b4ed-ccfd9c9e899f} + Jackett + + + + + {F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} + 1 + 0 + 0 + tlbimp + False + True + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + --> \ No newline at end of file diff --git a/src/Jackett.Tray/packages.config b/src/Jackett.Tray/packages.config index 2c84e7917..adfbfaad0 100644 --- a/src/Jackett.Tray/packages.config +++ b/src/Jackett.Tray/packages.config @@ -1,24 +1,24 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Jackett.Web/Index.html b/src/Jackett.Web/Index.html new file mode 100644 index 000000000..251700281 --- /dev/null +++ b/src/Jackett.Web/Index.html @@ -0,0 +1,39 @@ + + + + Jackett + + + + + +
+

Loading Jackett..

+ +
+ + + + + \ No newline at end of file diff --git a/src/Jackett.Web/Jackett.Web.csproj b/src/Jackett.Web/Jackett.Web.csproj new file mode 100644 index 000000000..750d51e4f --- /dev/null +++ b/src/Jackett.Web/Jackett.Web.csproj @@ -0,0 +1,239 @@ + + + + + + + + Debug + AnyCPU + + + 2.0 + {7A9699EE-AA9B-4843-A0B4-D1FEC47B0FFC} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Jackett.Web + Jackett.Web + v4.5.2 + true + + + + + + + + 1.6 + + + + + ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + True + + + + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll + True + + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + + + + + + + + + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll + True + + + + + + + + + + + + + + + + + Web.config + + + Web.config + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + bin\Release\ + + + + ES6 + True + False + None + False + + + False + True + True + $(TypeScriptAdditionalFlags) --emitDecoratorMetadata --experimentalDecorators --experimentalAsyncFunctions + true + true + true + + + + + ES6 + True + False + None + False + + + False + True + True + $(TypeScriptAdditionalFlags) --emitDecoratorMetadata --experimentalDecorators --experimentalAsyncFunctions + true + true + true + + + + + + + + + + + True + True + 58615 + / + http://localhost:49210/ + False + False + + + False + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/src/Jackett.Web/Properties/AssemblyInfo.cs b/src/Jackett.Web/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..da8429256 --- /dev/null +++ b/src/Jackett.Web/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Jackett.Web")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Jackett.Web")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7a9699ee-aa9b-4843-a0b4-d1fec47b0ffc")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Jackett.Web/Resources/DateToTimeConverter.js b/src/Jackett.Web/Resources/DateToTimeConverter.js new file mode 100644 index 000000000..d4f17c6d5 --- /dev/null +++ b/src/Jackett.Web/Resources/DateToTimeConverter.js @@ -0,0 +1,7 @@ +import 'moment'; +export class MomentValueConverter { + toView(value, format) { + return moment(value).format(format); + } +} +//# sourceMappingURL=DateToTimeConverter.js.map \ No newline at end of file diff --git a/src/Jackett.Web/Resources/DateToTimeConverter.js.map b/src/Jackett.Web/Resources/DateToTimeConverter.js.map new file mode 100644 index 000000000..7fd872a70 --- /dev/null +++ b/src/Jackett.Web/Resources/DateToTimeConverter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DateToTimeConverter.js","sourceRoot":"","sources":["DateToTimeConverter.ts"],"names":["MomentValueConverter","MomentValueConverter.toView"],"mappings":"OAAO,QAAQ;AAEf;IACIA,MAAMA,CAACA,KAAWA,EAAEA,MAAcA;QAC9BC,MAAMA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA,MAAMA,CAACA,MAAMA,CAACA,CAACA;IACxCA,CAACA;AACLD,CAACA;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/Resources/DateToTimeConverter2.js b/src/Jackett.Web/Resources/DateToTimeConverter2.js new file mode 100644 index 000000000..3ca5efb6d --- /dev/null +++ b/src/Jackett.Web/Resources/DateToTimeConverter2.js @@ -0,0 +1 @@ +//# sourceMappingURL=DateToTimeConverter2.js.map \ No newline at end of file diff --git a/src/Jackett.Web/Resources/DateToTimeConverter2.js.map b/src/Jackett.Web/Resources/DateToTimeConverter2.js.map new file mode 100644 index 000000000..eb3c624c1 --- /dev/null +++ b/src/Jackett.Web/Resources/DateToTimeConverter2.js.map @@ -0,0 +1 @@ +{"version":3,"file":"DateToTimeConverter2.js","sourceRoot":"","sources":["DateToTimeConverter2.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/Jackett.Web/Resources/MomentValueConverter.js b/src/Jackett.Web/Resources/MomentValueConverter.js new file mode 100644 index 000000000..bc7858294 --- /dev/null +++ b/src/Jackett.Web/Resources/MomentValueConverter.js @@ -0,0 +1,7 @@ +import moment from 'moment'; +export class MomentValueConverter { + toView(value, format) { + return moment(value).format(format); + } +} +//# sourceMappingURL=MomentValueConverter.js.map \ No newline at end of file diff --git a/src/Jackett.Web/Resources/MomentValueConverter.js.map b/src/Jackett.Web/Resources/MomentValueConverter.js.map new file mode 100644 index 000000000..73c940824 --- /dev/null +++ b/src/Jackett.Web/Resources/MomentValueConverter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MomentValueConverter.js","sourceRoot":"","sources":["MomentValueConverter.ts"],"names":["MomentValueConverter","MomentValueConverter.toView"],"mappings":"OAAO,MAAM,MAAM,QAAQ;AAE3B;IACIA,MAAMA,CAACA,KAAWA,EAAEA,MAAcA;QAC9BC,MAAMA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA,MAAMA,CAACA,MAAMA,CAACA,CAACA;IACxCA,CAACA;AACLD,CAACA;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/Resources/MomentValueConverter.ts b/src/Jackett.Web/Resources/MomentValueConverter.ts new file mode 100644 index 000000000..77f1e207a --- /dev/null +++ b/src/Jackett.Web/Resources/MomentValueConverter.ts @@ -0,0 +1,7 @@ +import moment from 'moment'; + +export class MomentValueConverter { + toView(value: Date, format: string) { + return moment(value).format(format); + } +} \ No newline at end of file diff --git a/src/Jackett.Web/Resources/index.js b/src/Jackett.Web/Resources/index.js new file mode 100644 index 000000000..a2b2b2f51 --- /dev/null +++ b/src/Jackett.Web/Resources/index.js @@ -0,0 +1,4 @@ +export function configure(aurelia) { + aurelia.globalizeResources('./MomentValueConverter'); +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/src/Jackett.Web/Resources/index.js.map b/src/Jackett.Web/Resources/index.js.map new file mode 100644 index 000000000..2c7a9d444 --- /dev/null +++ b/src/Jackett.Web/Resources/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":["configure"],"mappings":"AAAA,0BAA0B,OAAO;IAC7BA,OAAOA,CAACA,kBAAkBA,CAACA,wBAAwBA,CAACA,CAACA;AACzDA,CAACA"} \ No newline at end of file diff --git a/src/Jackett.Web/Resources/index.ts b/src/Jackett.Web/Resources/index.ts new file mode 100644 index 000000000..4af25cffa --- /dev/null +++ b/src/Jackett.Web/Resources/index.ts @@ -0,0 +1,3 @@ +export function configure(aurelia) { + aurelia.globalizeResources('./MomentValueConverter'); +} \ No newline at end of file diff --git a/src/Jackett.Web/Scripts/typings/JackettSignalr.d.ts b/src/Jackett.Web/Scripts/typings/JackettSignalr.d.ts new file mode 100644 index 000000000..0d26e39ff --- /dev/null +++ b/src/Jackett.Web/Scripts/typings/JackettSignalr.d.ts @@ -0,0 +1,17 @@ +/* This file contains the signalr services Jackett provides */ + export interface SignalR { + sync: HubProxy; + } + + export interface HubProxy { + client: ISyncClient; + } + + export interface ISyncClient { + onChange(); + onIRCMessage(m: IRCMessageCommand); + } + + export class IRCMessageCommand { + Id: string; + } diff --git a/src/Jackett.Web/Scripts/typings/jquery/jquery.d.ts b/src/Jackett.Web/Scripts/typings/jquery/jquery.d.ts new file mode 100644 index 000000000..ad9e93455 --- /dev/null +++ b/src/Jackett.Web/Scripts/typings/jquery/jquery.d.ts @@ -0,0 +1,3178 @@ +// Type definitions for jQuery 1.10.x / 2.0.x +// Project: http://jquery.com/ +// Definitions by: Boris Yankov , Christian Hoffmeister , Steve Fenton , Diullei Gomes , Tass Iliopoulos , Jason Swearingen , Sean Hill , Guus Goossens , Kelly Summerlin , Basarat Ali Syed , Nicholas Wolverson , Derek Cicerone , Andrew Gaspar , James Harrison Fisher , Seikichi Kondo , Benjamin Jackman , Poul Sorensen , Josh Strobl , John Reilly , Dick van den Brink +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/* ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +/** + * Interface for the AJAX setting that will configure the AJAX request + */ +interface JQueryAjaxSettings { + /** + * The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. + */ + accepts?: any; + /** + * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success(). + */ + async?: boolean; + /** + * A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request. + */ + beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any; + /** + * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. + */ + cache?: boolean; + /** + * A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + */ + complete? (jqXHR: JQueryXHR, textStatus: string): any; + /** + * An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5) + */ + contents?: { [key: string]: any; }; + //According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false" + // https://github.com/borisyankov/DefinitelyTyped/issues/742 + /** + * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. + */ + contentType?: any; + /** + * This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax). + */ + context?: any; + /** + * An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5) + */ + converters?: { [key: string]: any; }; + /** + * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5) + */ + crossDomain?: boolean; + /** + * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). + */ + data?: any; + /** + * A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. + */ + dataFilter? (data: any, ty: any): any; + /** + * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). + */ + dataType?: string; + /** + * A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event. + */ + error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any; + /** + * Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events. + */ + global?: boolean; + /** + * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5) + */ + headers?: { [key: string]: any; }; + /** + * Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data. + */ + ifModified?: boolean; + /** + * Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1) + */ + isLocal?: boolean; + /** + * Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" } + */ + jsonp?: any; + /** + * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. + */ + jsonpCallback?: any; + /** + * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0) + */ + method?: string; + /** + * A mime type to override the XHR mime type. (version added: 1.5.1) + */ + mimeType?: string; + /** + * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + password?: string; + /** + * By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false. + */ + processData?: boolean; + /** + * Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script. + */ + scriptCharset?: string; + /** + * An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5) + */ + statusCode?: { [key: string]: any; }; + /** + * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. + */ + success? (data: any, textStatus: string, jqXHR: JQueryXHR): any; + /** + * Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period. + */ + timeout?: number; + /** + * Set this to true if you wish to use the traditional style of param serialization. + */ + traditional?: boolean; + /** + * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers. + */ + type?: string; + /** + * A string containing the URL to which the request is sent. + */ + url?: string; + /** + * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + username?: string; + /** + * Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory. + */ + xhr?: any; + /** + * An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1) + */ + xhrFields?: { [key: string]: any; }; +} + +/** + * Interface for the jqXHR object + */ +interface JQueryXHR extends XMLHttpRequest, JQueryPromise { + /** + * The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5). + */ + overrideMimeType(mimeType: string): any; + /** + * Cancel the request. + * + * @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled" + */ + abort(statusText?: string): void; + /** + * Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details. + */ + then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise; + /** + * Property containing the parsed response if the response Content-Type is json + */ + responseJSON?: any; + /** + * A function to be called if the request fails. + */ + error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void; +} + +/** + * Interface for the JQuery callback + */ +interface JQueryCallback { + /** + * Add a callback or a collection of callbacks to a callback list. + * + * @param callbacks A function, or array of functions, that are to be added to the callback list. + */ + add(callbacks: Function): JQueryCallback; + /** + * Add a callback or a collection of callbacks to a callback list. + * + * @param callbacks A function, or array of functions, that are to be added to the callback list. + */ + add(callbacks: Function[]): JQueryCallback; + + /** + * Disable a callback list from doing anything more. + */ + disable(): JQueryCallback; + + /** + * Determine if the callbacks list has been disabled. + */ + disabled(): boolean; + + /** + * Remove all of the callbacks from a list. + */ + empty(): JQueryCallback; + + /** + * Call all of the callbacks with the given arguments + * + * @param arguments The argument or list of arguments to pass back to the callback list. + */ + fire(...arguments: any[]): JQueryCallback; + + /** + * Determine if the callbacks have already been called at least once. + */ + fired(): boolean; + + /** + * Call all callbacks in a list with the given context and arguments. + * + * @param context A reference to the context in which the callbacks in the list should be fired. + * @param arguments An argument, or array of arguments, to pass to the callbacks in the list. + */ + fireWith(context?: any, ...args: any[]): JQueryCallback; + + /** + * Determine whether a supplied callback is in a list + * + * @param callback The callback to search for. + */ + has(callback: Function): boolean; + + /** + * Lock a callback list in its current state. + */ + lock(): JQueryCallback; + + /** + * Determine if the callbacks list has been locked. + */ + locked(): boolean; + + /** + * Remove a callback or a collection of callbacks from a callback list. + * + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + */ + remove(callbacks: Function): JQueryCallback; + /** + * Remove a callback or a collection of callbacks from a callback list. + * + * @param callbacks A function, or array of functions, that are to be removed from the callback list. + */ + remove(callbacks: Function[]): JQueryCallback; +} + +/** + * Allows jQuery Promises to interop with non-jQuery promises + */ +interface JQueryGenericPromise { + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + */ + then(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; + + /** + * Add handlers to be called when the Deferred object is resolved, rejected, or still in progress. + * + * @param doneFilter A function that is called when the Deferred is resolved. + * @param failFilter An optional function that is called when the Deferred is rejected. + */ + then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise; +} + +/** + * Interface for the JQuery promise/deferred callbacks + */ +interface JQueryPromiseCallback { + (value?: T, ...args: any[]): void; +} + +interface JQueryPromiseOperator { + (callback1: JQueryPromiseCallback|JQueryPromiseCallback[], ...callbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; +} + +/** + * Interface for the JQuery promise, part of callbacks + */ +interface JQueryPromise extends JQueryGenericPromise { + /** + * Determine the current state of a Deferred object. + */ + state(): string; + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * + * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + */ + always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object is resolved. + * + * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + */ + done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + */ + fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryPromise; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * + * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. + */ + progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + + // Deprecated - given no typings + pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; +} + +/** + * Interface for the JQuery deferred, part of callbacks + */ +interface JQueryDeferred extends JQueryGenericPromise { + /** + * Determine the current state of a Deferred object. + */ + state(): string; + /** + * Add handlers to be called when the Deferred object is either resolved or rejected. + * + * @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected. + * @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected. + */ + always(alwaysCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...alwaysCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object is resolved. + * + * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. + * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. + */ + done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object is rejected. + * + * @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected. + * @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected. + */ + fail(failCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...failCallbacksN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + /** + * Add handlers to be called when the Deferred object generates progress notifications. + * + * @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications. + */ + progress(progressCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...progressCallbackN: Array|JQueryPromiseCallback[]>): JQueryDeferred; + + /** + * Call the progressCallbacks on a Deferred object with the given args. + * + * @param args Optional arguments that are passed to the progressCallbacks. + */ + notify(value?: any, ...args: any[]): JQueryDeferred; + + /** + * Call the progressCallbacks on a Deferred object with the given context and args. + * + * @param context Context passed to the progressCallbacks as the this object. + * @param args Optional arguments that are passed to the progressCallbacks. + */ + notifyWith(context: any, value?: any, ...args: any[]): JQueryDeferred; + + /** + * Reject a Deferred object and call any failCallbacks with the given args. + * + * @param args Optional arguments that are passed to the failCallbacks. + */ + reject(value?: any, ...args: any[]): JQueryDeferred; + /** + * Reject a Deferred object and call any failCallbacks with the given context and args. + * + * @param context Context passed to the failCallbacks as the this object. + * @param args An optional array of arguments that are passed to the failCallbacks. + */ + rejectWith(context: any, value?: any, ...args: any[]): JQueryDeferred; + + /** + * Resolve a Deferred object and call any doneCallbacks with the given args. + * + * @param value First argument passed to doneCallbacks. + * @param args Optional subsequent arguments that are passed to the doneCallbacks. + */ + resolve(value?: T, ...args: any[]): JQueryDeferred; + + /** + * Resolve a Deferred object and call any doneCallbacks with the given context and args. + * + * @param context Context passed to the doneCallbacks as the this object. + * @param args An optional array of arguments that are passed to the doneCallbacks. + */ + resolveWith(context: any, value?: T, ...args: any[]): JQueryDeferred; + + /** + * Return a Deferred's Promise object. + * + * @param target Object onto which the promise methods have to be attached + */ + promise(target?: any): JQueryPromise; + + // Deprecated - given no typings + pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; +} + +/** + * Interface of the JQuery extension of the W3C event object + */ +interface BaseJQueryEventObject extends Event { + data: any; + delegateTarget: Element; + isDefaultPrevented(): boolean; + isImmediatePropagationStopped(): boolean; + isPropagationStopped(): boolean; + namespace: string; + originalEvent: Event; + preventDefault(): any; + relatedTarget: Element; + result: any; + stopImmediatePropagation(): void; + stopPropagation(): void; + target: Element; + pageX: number; + pageY: number; + which: number; + metaKey: boolean; +} + +interface JQueryInputEventObject extends BaseJQueryEventObject { + altKey: boolean; + ctrlKey: boolean; + metaKey: boolean; + shiftKey: boolean; +} + +interface JQueryMouseEventObject extends JQueryInputEventObject { + button: number; + clientX: number; + clientY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; +} + +interface JQueryKeyEventObject extends JQueryInputEventObject { + char: any; + charCode: number; + key: any; + keyCode: number; +} + +interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{ +} + +/* + Collection of properties of the current browser +*/ + +interface JQuerySupport { + ajax?: boolean; + boxModel?: boolean; + changeBubbles?: boolean; + checkClone?: boolean; + checkOn?: boolean; + cors?: boolean; + cssFloat?: boolean; + hrefNormalized?: boolean; + htmlSerialize?: boolean; + leadingWhitespace?: boolean; + noCloneChecked?: boolean; + noCloneEvent?: boolean; + opacity?: boolean; + optDisabled?: boolean; + optSelected?: boolean; + scriptEval? (): boolean; + style?: boolean; + submitBubbles?: boolean; + tbody?: boolean; +} + +interface JQueryParam { + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * + * @param obj An array or object to serialize. + */ + (obj: any): string; + + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + * + * @param obj An array or object to serialize. + * @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization. + */ + (obj: any, traditional: boolean): string; +} + +/** + * The interface used to construct jQuery events (with $.Event). It is + * defined separately instead of inline in JQueryStatic to allow + * overriding the construction function with specific strings + * returning specific event objects. + */ +interface JQueryEventConstructor { + (name: string, eventProperties?: any): JQueryEventObject; + new (name: string, eventProperties?: any): JQueryEventObject; +} + +/** + * The interface used to specify coordinates. + */ +interface JQueryCoordinates { + left: number; + top: number; +} + +/** + * Elements in the array returned by serializeArray() + */ +interface JQuerySerializeArrayElement { + name: string; + value: string; +} + +interface JQueryAnimationOptions { + /** + * A string or number determining how long the animation will run. + */ + duration?: any; + /** + * A string indicating which easing function to use for the transition. + */ + easing?: string; + /** + * A function to call once the animation is complete. + */ + complete?: Function; + /** + * A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set. + */ + step?: (now: number, tween: any) => any; + /** + * A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8) + */ + progress?: (animation: JQueryPromise, progress: number, remainingMs: number) => any; + /** + * A function to call when the animation begins. (version added: 1.8) + */ + start?: (animation: JQueryPromise) => any; + /** + * A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8) + */ + done?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8) + */ + fail?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8) + */ + always?: (animation: JQueryPromise, jumpedToEnd: boolean) => any; + /** + * A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it. + */ + queue?: any; + /** + * A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4) + */ + specialEasing?: Object; +} + +/** + * Static members of jQuery (those on $ and jQuery themselves) + */ +interface JQueryStatic { + + /** + * Perform an asynchronous HTTP (Ajax) request. + * + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). + */ + ajax(settings: JQueryAjaxSettings): JQueryXHR; + /** + * Perform an asynchronous HTTP (Ajax) request. + * + * @param url A string containing the URL to which the request is sent. + * @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). + */ + ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR; + + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + * + * @param dataTypes An optional string containing one or more space-separated dataTypes + * @param handler A handler to set default values for future Ajax requests. + */ + ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; + /** + * Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax(). + * + * @param handler A handler to set default values for future Ajax requests. + */ + ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; + + ajaxSettings: JQueryAjaxSettings; + + /** + * Set default values for future Ajax requests. Its use is not recommended. + * + * @param options A set of key/value pairs that configure the default Ajax request. All options are optional. + */ + ajaxSetup(options: JQueryAjaxSettings): void; + + /** + * Load data from the server using a HTTP GET request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). + */ + get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP GET request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). + */ + get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + */ + getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + */ + getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + /** + * Load a JavaScript file from the server using a GET HTTP request, then execute it. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + */ + getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR; + + /** + * Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. + */ + param: JQueryParam; + + /** + * Load data from the server using a HTTP POST request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + */ + post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP POST request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). + */ + post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + + /** + * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. + * + * @param flags An optional list of space-separated flags that change how the callback list behaves. + */ + Callbacks(flags?: string): JQueryCallback; + + /** + * Holds or releases the execution of jQuery's ready event. + * + * @param hold Indicates whether the ready hold is being requested or released + */ + holdReady(hold: boolean): void; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param selector A string containing a selector expression + * @param context A DOM Element, Document, or jQuery to use as context + */ + (selector: string, context?: Element|JQuery): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param element A DOM element to wrap in a jQuery object. + */ + (element: Element): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param elementArray An array containing a set of DOM elements to wrap in a jQuery object. + */ + (elementArray: Element[]): JQuery; + + /** + * Binds a function to be executed when the DOM has finished loading. + * + * @param callback A function to execute after the DOM is ready. + */ + (callback: (jQueryAlias?: JQueryStatic) => any): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param object A plain object to wrap in a jQuery object. + */ + (object: {}): JQuery; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param object An existing jQuery object to clone. + */ + (object: JQuery): JQuery; + + /** + * Specify a function to execute when the DOM is fully loaded. + */ + (): JQuery; + + /** + * Creates DOM elements on the fly from the provided string of raw HTML. + * + * @param html A string of HTML to create on the fly. Note that this parses HTML, not XML. + * @param ownerDocument A document in which the new elements will be created. + */ + (html: string, ownerDocument?: Document): JQuery; + + /** + * Creates DOM elements on the fly from the provided string of raw HTML. + * + * @param html A string defining a single, standalone, HTML element (e.g.
or
). + * @param attributes An object of attributes, events, and methods to call on the newly-created element. + */ + (html: string, attributes: Object): JQuery; + + /** + * Relinquish jQuery's control of the $ variable. + * + * @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). + */ + noConflict(removeAll?: boolean): Object; + + /** + * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. + * + * @param deferreds One or more Deferred objects, or plain JavaScript objects. + */ + when(...deferreds: Array/* as JQueryDeferred */>): JQueryPromise; + + /** + * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. + */ + cssHooks: { [key: string]: any; }; + cssNumber: any; + + /** + * Store arbitrary data associated with the specified element. Returns the value that was set. + * + * @param element The DOM element to associate with the data. + * @param key A string naming the piece of data to set. + * @param value The new data value. + */ + data(element: Element, key: string, value: T): T; + /** + * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. + * + * @param element The DOM element to associate with the data. + * @param key A string naming the piece of data to set. + */ + data(element: Element, key: string): any; + /** + * Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element. + * + * @param element The DOM element to associate with the data. + */ + data(element: Element): any; + + /** + * Execute the next function on the queue for the matched element. + * + * @param element A DOM element from which to remove and execute a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + dequeue(element: Element, queueName?: string): void; + + /** + * Determine whether an element has any jQuery data associated with it. + * + * @param element A DOM element to be checked for data. + */ + hasData(element: Element): boolean; + + /** + * Show the queue of functions to be executed on the matched element. + * + * @param element A DOM element to inspect for an attached queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + queue(element: Element, queueName?: string): any[]; + /** + * Manipulate the queue of functions to be executed on the matched element. + * + * @param element A DOM element where the array of queued functions is attached. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(element: Element, queueName: string, newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed on the matched element. + * + * @param element A DOM element on which to add a queued function. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param callback The new function to add to the queue. + */ + queue(element: Element, queueName: string, callback: Function): JQuery; + + /** + * Remove a previously-stored piece of data. + * + * @param element A DOM element from which to remove data. + * @param name A string naming the piece of data to remove. + */ + removeData(element: Element, name?: string): JQuery; + + /** + * A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function. + * + * @param beforeStart A function that is called just before the constructor returns. + */ + Deferred(beforeStart?: (deferred: JQueryDeferred) => any): JQueryDeferred; + + /** + * Effects + */ + fx: { + tick: () => void; + /** + * The rate (in milliseconds) at which animations fire. + */ + interval: number; + stop: () => void; + speeds: { slow: number; fast: number; }; + /** + * Globally disable all animations. + */ + off: boolean; + step: any; + }; + + /** + * Takes a function and returns a new one that will always have a particular context. + * + * @param fnction The function whose context will be changed. + * @param context The object to which the context (this) of the function should be set. + * @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument. + */ + proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any; + /** + * Takes a function and returns a new one that will always have a particular context. + * + * @param context The object to which the context (this) of the function should be set. + * @param name The name of the function whose context will be changed (should be a property of the context object). + * @param additionalArguments Any number of arguments to be passed to the function named in the name argument. + */ + proxy(context: Object, name: string, ...additionalArguments: any[]): any; + + Event: JQueryEventConstructor; + + /** + * Takes a string and throws an exception containing it. + * + * @param message The message to send out. + */ + error(message: any): JQuery; + + expr: any; + fn: any; //TODO: Decide how we want to type this + + isReady: boolean; + + // Properties + support: JQuerySupport; + + /** + * Check to see if a DOM element is a descendant of another DOM element. + * + * @param container The DOM element that may contain the other element. + * @param contained The DOM element that may be contained by (a descendant of) the other element. + */ + contains(container: Element, contained: Element): boolean; + + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + */ + each( + collection: T[], + callback: (indexInArray: number, valueOfElement: T) => any + ): any; + + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + */ + each( + collection: any, + callback: (indexInArray: any, valueOfElement: any) => any + ): any; + + /** + * Merge the contents of two or more objects together into the first object. + * + * @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + */ + extend(target: any, object1?: any, ...objectN: any[]): any; + /** + * Merge the contents of two or more objects together into the first object. + * + * @param deep If true, the merge becomes recursive (aka. deep copy). + * @param target The object to extend. It will receive the new properties. + * @param object1 An object containing additional properties to merge in. + * @param objectN Additional objects containing properties to merge in. + */ + extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any; + + /** + * Execute some JavaScript code globally. + * + * @param code The JavaScript code to execute. + */ + globalEval(code: string): any; + + /** + * Finds the elements of an array which satisfy a filter function. The original array is not affected. + * + * @param array The array to search through. + * @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object. + * @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false. + */ + grep(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[]; + + /** + * Search for a specified value within an array and return its index (or -1 if not found). + * + * @param value The value to search for. + * @param array An array through which to search. + * @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array. + */ + inArray(value: T, array: T[], fromIndex?: number): number; + + /** + * Determine whether the argument is an array. + * + * @param obj Object to test whether or not it is an array. + */ + isArray(obj: any): boolean; + /** + * Check to see if an object is empty (contains no enumerable properties). + * + * @param obj The object that will be checked to see if it's empty. + */ + isEmptyObject(obj: any): boolean; + /** + * Determine if the argument passed is a Javascript function object. + * + * @param obj Object to test whether or not it is a function. + */ + isFunction(obj: any): boolean; + /** + * Determines whether its argument is a number. + * + * @param obj The value to be tested. + */ + isNumeric(value: any): boolean; + /** + * Check to see if an object is a plain object (created using "{}" or "new Object"). + * + * @param obj The object that will be checked to see if it's a plain object. + */ + isPlainObject(obj: any): boolean; + /** + * Determine whether the argument is a window. + * + * @param obj Object to test whether or not it is a window. + */ + isWindow(obj: any): boolean; + /** + * Check to see if a DOM node is within an XML document (or is an XML document). + * + * @param node he DOM node that will be checked to see if it's in an XML document. + */ + isXMLDoc(node: Node): boolean; + + /** + * Convert an array-like object into a true JavaScript array. + * + * @param obj Any object to turn into a native Array. + */ + makeArray(obj: any): any[]; + + /** + * Translate all items in an array or object to new array of items. + * + * @param array The Array to translate. + * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. + */ + map(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[]; + /** + * Translate all items in an array or object to new array of items. + * + * @param arrayOrObject The Array or Object to translate. + * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. + */ + map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any; + + /** + * Merge the contents of two arrays together into the first array. + * + * @param first The first array to merge, the elements of second added. + * @param second The second array to merge into the first, unaltered. + */ + merge(first: T[], second: T[]): T[]; + + /** + * An empty function. + */ + noop(): any; + + /** + * Return a number representing the current time. + */ + now(): number; + + /** + * Takes a well-formed JSON string and returns the resulting JavaScript object. + * + * @param json The JSON string to parse. + */ + parseJSON(json: string): any; + + /** + * Parses a string into an XML document. + * + * @param data a well-formed XML string to be parsed + */ + parseXML(data: string): XMLDocument; + + /** + * Remove the whitespace from the beginning and end of a string. + * + * @param str Remove the whitespace from the beginning and end of a string. + */ + trim(str: string): string; + + /** + * Determine the internal JavaScript [[Class]] of an object. + * + * @param obj Object to get the internal JavaScript [[Class]] of. + */ + type(obj: any): string; + + /** + * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. + * + * @param array The Array of DOM elements. + */ + unique(array: Element[]): Element[]; + + /** + * Parses a string into an array of DOM nodes. + * + * @param data HTML string to be parsed + * @param context DOM element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + */ + parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; + + /** + * Parses a string into an array of DOM nodes. + * + * @param data HTML string to be parsed + * @param context DOM element to serve as the context in which the HTML fragment will be created + * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string + */ + parseHTML(data: string, context?: Document, keepScripts?: boolean): any[]; +} + +/** + * The jQuery instance members + */ +interface JQuery { + /** + * Register a handler to be called when Ajax requests complete. This is an AjaxEvent. + * + * @param handler The function to be invoked. + */ + ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery; + /** + * Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery; + /** + * Attach a function to be executed before an Ajax request is sent. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery; + /** + * Register a handler to be called when the first Ajax request begins. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxStart(handler: () => any): JQuery; + /** + * Register a handler to be called when all Ajax requests have completed. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxStop(handler: () => any): JQuery; + /** + * Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event. + * + * @param handler The function to be invoked. + */ + ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery; + + /** + * Load data from the server and place the returned HTML into the matched element. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param complete A callback function that is executed when the request completes. + */ + load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery; + + /** + * Encode a set of form elements as a string for submission. + */ + serialize(): string; + /** + * Encode a set of form elements as an array of names and values. + */ + serializeArray(): JQuerySerializeArrayElement[]; + + /** + * Adds the specified class(es) to each of the set of matched elements. + * + * @param className One or more space-separated classes to be added to the class attribute of each matched element. + */ + addClass(className: string): JQuery; + /** + * Adds the specified class(es) to each of the set of matched elements. + * + * @param function A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set. + */ + addClass(func: (index: number, className: string) => string): JQuery; + + /** + * Add the previous set of elements on the stack to the current set, optionally filtered by a selector. + */ + addBack(selector?: string): JQuery; + + /** + * Get the value of an attribute for the first element in the set of matched elements. + * + * @param attributeName The name of the attribute to get. + */ + attr(attributeName: string): string; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributeName The name of the attribute to set. + * @param value A value to set for the attribute. + */ + attr(attributeName: string, value: string|number): JQuery; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributeName The name of the attribute to set. + * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments. + */ + attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery; + /** + * Set one or more attributes for the set of matched elements. + * + * @param attributes An object of attribute-value pairs to set. + */ + attr(attributes: Object): JQuery; + + /** + * Determine whether any of the matched elements are assigned the given class. + * + * @param className The class name to search for. + */ + hasClass(className: string): boolean; + + /** + * Get the HTML contents of the first element in the set of matched elements. + */ + html(): string; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param htmlString A string of HTML to set as the content of each matched element. + */ + html(htmlString: string): JQuery; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. + */ + html(func: (index: number, oldhtml: string) => string): JQuery; + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set. + */ + + /** + * Get the value of a property for the first element in the set of matched elements. + * + * @param propertyName The name of the property to get. + */ + prop(propertyName: string): any; + /** + * Set one or more properties for the set of matched elements. + * + * @param propertyName The name of the property to set. + * @param value A value to set for the property. + */ + prop(propertyName: string, value: string|number|boolean): JQuery; + /** + * Set one or more properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + */ + prop(properties: Object): JQuery; + /** + * Set one or more properties for the set of matched elements. + * + * @param propertyName The name of the property to set. + * @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element. + */ + prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery; + + /** + * Remove an attribute from each element in the set of matched elements. + * + * @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes. + */ + removeAttr(attributeName: string): JQuery; + + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * + * @param className One or more space-separated classes to be removed from the class attribute of each matched element. + */ + removeClass(className?: string): JQuery; + /** + * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. + * + * @param function A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments. + */ + removeClass(func: (index: number, className: string) => string): JQuery; + + /** + * Remove a property for the set of matched elements. + * + * @param propertyName The name of the property to remove. + */ + removeProp(propertyName: string): JQuery; + + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. + * @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed. + */ + toggleClass(className: string, swtch?: boolean): JQuery; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param swtch A boolean value to determine whether the class should be added or removed. + */ + toggleClass(swtch?: boolean): JQuery; + /** + * Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument. + * + * @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments. + * @param swtch A boolean value to determine whether the class should be added or removed. + */ + toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery; + + /** + * Get the current value of the first element in the set of matched elements. + */ + val(): any; + /** + * Set the value of each element in the set of matched elements. + * + * @param value A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked. + */ + val(value: string|string[]): JQuery; + /** + * Set the value of each element in the set of matched elements. + * + * @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + */ + val(func: (index: number, value: string) => string): JQuery; + + + /** + * Get the value of style properties for the first element in the set of matched elements. + * + * @param propertyName A CSS property. + */ + css(propertyName: string): string; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A value to set for the property. + */ + css(propertyName: string, value: string|number): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + */ + css(propertyName: string, value: (index: number, value: string) => string|number): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + */ + css(properties: Object): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements. + */ + height(): number; + /** + * Set the CSS height of every matched element. + * + * @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string). + */ + height(value: number|string): JQuery; + /** + * Set the CSS height of every matched element. + * + * @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set. + */ + height(func: (index: number, height: number) => number|string): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements, including padding but not border. + */ + innerHeight(): number; + + /** + * Sets the inner height on elements in the set of matched elements, including padding but not border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + innerHeight(height: number|string): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements, including padding but not border. + */ + innerWidth(): number; + + /** + * Sets the inner width on elements in the set of matched elements, including padding but not border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + innerWidth(width: number|string): JQuery; + + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the document. + */ + offset(): JQueryCoordinates; + /** + * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + * + * @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + */ + offset(coordinates: JQueryCoordinates): JQuery; + /** + * An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements. + * + * @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties. + */ + offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery; + + /** + * Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + */ + outerHeight(includeMargin?: boolean): number; + + /** + * Sets the outer height on elements in the set of matched elements, including padding and border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + outerHeight(height: number|string): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements, including padding and border. + * + * @param includeMargin A Boolean indicating whether to include the element's margin in the calculation. + */ + outerWidth(includeMargin?: boolean): number; + + /** + * Sets the outer width on elements in the set of matched elements, including padding and border. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + outerWidth(width: number|string): JQuery; + + /** + * Get the current coordinates of the first element in the set of matched elements, relative to the offset parent. + */ + position(): JQueryCoordinates; + + /** + * Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element. + */ + scrollLeft(): number; + /** + * Set the current horizontal position of the scroll bar for each of the set of matched elements. + * + * @param value An integer indicating the new position to set the scroll bar to. + */ + scrollLeft(value: number): JQuery; + + /** + * Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. + */ + scrollTop(): number; + /** + * Set the current vertical position of the scroll bar for each of the set of matched elements. + * + * @param value An integer indicating the new position to set the scroll bar to. + */ + scrollTop(value: number): JQuery; + + /** + * Get the current computed width for the first element in the set of matched elements. + */ + width(): number; + /** + * Set the CSS width of each element in the set of matched elements. + * + * @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string). + */ + width(value: number|string): JQuery; + /** + * Set the CSS width of each element in the set of matched elements. + * + * @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set. + */ + width(func: (index: number, width: number) => number|string): JQuery; + + /** + * Remove from the queue all items that have not yet been run. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + clearQueue(queueName?: string): JQuery; + + /** + * Store arbitrary data associated with the matched elements. + * + * @param key A string naming the piece of data to set. + * @param value The new data value; it can be any Javascript type including Array or Object. + */ + data(key: string, value: any): JQuery; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + * + * @param key Name of the data stored. + */ + data(key: string): any; + /** + * Store arbitrary data associated with the matched elements. + * + * @param obj An object of key-value pairs of data to update. + */ + data(obj: { [key: string]: any; }): JQuery; + /** + * Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute. + */ + data(): any; + + /** + * Execute the next function on the queue for the matched elements. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + dequeue(queueName?: string): JQuery; + + /** + * Remove a previously-stored piece of data. + * + * @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete. + */ + removeData(name: string): JQuery; + /** + * Remove a previously-stored piece of data. + * + * @param list An array of strings naming the pieces of data to delete. + */ + removeData(list: string[]): JQuery; + + /** + * Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished. + * + * @param type The type of queue that needs to be observed. (default: fx) + * @param target Object onto which the promise methods have to be attached + */ + promise(type?: string, target?: Object): JQueryPromise; + + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + animate(properties: Object, duration?: string|number, complete?: Function): JQuery; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. (default: swing) + * @param complete A function to call once the animation is complete. + */ + animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery; + /** + * Perform a custom animation of a set of CSS properties. + * + * @param properties An object of CSS properties and values that the animation will move toward. + * @param options A map of additional options to pass to the method. + */ + animate(properties: Object, options: JQueryAnimationOptions): JQuery; + + /** + * Set a timer to delay execution of subsequent items in the queue. + * + * @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue. + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + delay(duration: number, queueName?: string): JQuery; + + /** + * Display the matched elements by fading them to opaque. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeIn(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements by fading them to opaque. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements by fading them to opaque. + * + * @param options A map of additional options to pass to the method. + */ + fadeIn(options: JQueryAnimationOptions): JQuery; + + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeOut(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements by fading them to transparent. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements by fading them to transparent. + * + * @param options A map of additional options to pass to the method. + */ + fadeOut(options: JQueryAnimationOptions): JQuery; + + /** + * Adjust the opacity of the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param complete A function to call once the animation is complete. + */ + fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery; + /** + * Adjust the opacity of the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param opacity A number between 0 and 1 denoting the target opacity. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery; + + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + fadeToggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements by animating their opacity. + * + * @param options A map of additional options to pass to the method. + */ + fadeToggle(options: JQueryAnimationOptions): JQuery; + + /** + * Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements. + * + * @param queue The name of the queue in which to stop animations. + */ + finish(queue?: string): JQuery; + + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + hide(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + hide(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + hide(options: JQueryAnimationOptions): JQuery; + + /** + * Display the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + show(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + show(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + show(options: JQueryAnimationOptions): JQuery; + + /** + * Display the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideDown(duration?: number|string, complete?: Function): JQuery; + /** + * Display the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideDown(options: JQueryAnimationOptions): JQuery; + + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideToggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideToggle(options: JQueryAnimationOptions): JQuery; + + /** + * Hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + slideUp(duration?: number|string, complete?: Function): JQuery; + /** + * Hide the matched elements with a sliding motion. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Hide the matched elements with a sliding motion. + * + * @param options A map of additional options to pass to the method. + */ + slideUp(options: JQueryAnimationOptions): JQuery; + + /** + * Stop the currently-running animation on the matched elements. + * + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + */ + stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery; + /** + * Stop the currently-running animation on the matched elements. + * + * @param queue The name of the queue in which to stop animations. + * @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false. + * @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false. + */ + stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery; + + /** + * Display or hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param complete A function to call once the animation is complete. + */ + toggle(duration?: number|string, complete?: Function): JQuery; + /** + * Display or hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param easing A string indicating which easing function to use for the transition. + * @param complete A function to call once the animation is complete. + */ + toggle(duration?: number|string, easing?: string, complete?: Function): JQuery; + /** + * Display or hide the matched elements. + * + * @param options A map of additional options to pass to the method. + */ + toggle(options: JQueryAnimationOptions): JQuery; + /** + * Display or hide the matched elements. + * + * @param showOrHide A Boolean indicating whether to show or hide the elements. + */ + toggle(showOrHide: boolean): JQuery; + + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + */ + bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + */ + bind(eventType: string, eventData: any, preventBubble: boolean): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + */ + bind(eventType: string, preventBubble: boolean): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param events An object containing one or more DOM event types and functions to execute for them. + */ + bind(events: any): JQuery; + + /** + * Trigger the "blur" event on an element + */ + blur(): JQuery; + /** + * Bind an event handler to the "blur" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + blur(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "blur" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "change" event on an element. + */ + change(): JQuery; + /** + * Bind an event handler to the "change" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + change(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "change" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "click" event on an element. + */ + click(): JQuery; + /** + * Bind an event handler to the "click" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + */ + click(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "click" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "dblclick" event on an element. + */ + dblclick(): JQuery; + /** + * Bind an event handler to the "dblclick" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "dblclick" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "focus" event on an element. + */ + focus(): JQuery; + /** + * Bind an event handler to the "focus" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + focus(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focus" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Bind an event handler to the "focusin" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + focusin(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focusin" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Bind an event handler to the "focusout" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + focusout(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "focusout" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements. + * + * @param handlerIn A function to execute when the mouse pointer enters the element. + * @param handlerOut A function to execute when the mouse pointer leaves the element. + */ + hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements. + * + * @param handlerInOut A function to execute when the mouse pointer enters or leaves the element. + */ + hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "keydown" event on an element. + */ + keydown(): JQuery; + /** + * Bind an event handler to the "keydown" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keydown" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Trigger the "keypress" event on an element. + */ + keypress(): JQuery; + /** + * Bind an event handler to the "keypress" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keypress" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Trigger the "keyup" event on an element. + */ + keyup(): JQuery; + /** + * Bind an event handler to the "keyup" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery; + /** + * Bind an event handler to the "keyup" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery; + + /** + * Bind an event handler to the "load" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + load(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "load" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "mousedown" event on an element. + */ + mousedown(): JQuery; + /** + * Bind an event handler to the "mousedown" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mousedown" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseenter" event on an element. + */ + mouseenter(): JQuery; + /** + * Bind an event handler to be fired when the mouse enters an element. + * + * @param handler A function to execute when the event is triggered. + */ + mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to be fired when the mouse enters an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseleave" event on an element. + */ + mouseleave(): JQuery; + /** + * Bind an event handler to be fired when the mouse leaves an element. + * + * @param handler A function to execute when the event is triggered. + */ + mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to be fired when the mouse leaves an element. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mousemove" event on an element. + */ + mousemove(): JQuery; + /** + * Bind an event handler to the "mousemove" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mousemove" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseout" event on an element. + */ + mouseout(): JQuery; + /** + * Bind an event handler to the "mouseout" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseout" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseover" event on an element. + */ + mouseover(): JQuery; + /** + * Bind an event handler to the "mouseover" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseover" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Trigger the "mouseup" event on an element. + */ + mouseup(): JQuery; + /** + * Bind an event handler to the "mouseup" JavaScript event. + * + * @param handler A function to execute when the event is triggered. + */ + mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + /** + * Bind an event handler to the "mouseup" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery; + + /** + * Remove an event handler. + */ + off(): JQuery; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + * @param handler A handler function previously attached for the event(s), or the special value false. + */ + off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param handler A handler function previously attached for the event(s), or the special value false. + */ + off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove an event handler. + * + * @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s). + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + */ + off(events: { [key: string]: any; }, selector?: string): JQuery; + + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax). + */ + on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + on(events: { [key: string]: any; }, data?: any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute at the time the event is triggered. + */ + one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. + * @param data An object containing data that will be passed to the event handler. + * @param handler A function to execute at the time the event is triggered. + */ + one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s). + * @param data Data to be passed to the handler in event.data when an event occurs. + */ + one(events: { [key: string]: any; }, data?: any): JQuery; + + + /** + * Specify a function to execute when the DOM is fully loaded. + * + * @param handler A function to execute after the DOM is ready. + */ + ready(handler: (jQueryAlias?: JQueryStatic) => any): JQuery; + + /** + * Trigger the "resize" event on an element. + */ + resize(): JQuery; + /** + * Bind an event handler to the "resize" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + */ + resize(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "resize" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "scroll" event on an element. + */ + scroll(): JQuery; + /** + * Bind an event handler to the "scroll" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + */ + scroll(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "scroll" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "select" event on an element. + */ + select(): JQuery; + /** + * Bind an event handler to the "select" JavaScript event. + * + * @param handler A function to execute each time the event is triggered. + */ + select(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "select" JavaScript event. + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Trigger the "submit" event on an element. + */ + submit(): JQuery; + /** + * Bind an event handler to the "submit" JavaScript event + * + * @param handler A function to execute each time the event is triggered. + */ + submit(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "submit" JavaScript event + * + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param extraParameters Additional parameters to pass along to the event handler. + */ + trigger(eventType: string, extraParameters?: any[]|Object): JQuery; + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * + * @param event A jQuery.Event object. + * @param extraParameters Additional parameters to pass along to the event handler. + */ + trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery; + + /** + * Execute all handlers attached to an element for an event. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param extraParameters An array of additional parameters to pass along to the event handler. + */ + triggerHandler(eventType: string, ...extraParameters: any[]): Object; + + /** + * Execute all handlers attached to an element for an event. + * + * @param event A jQuery.Event object. + * @param extraParameters An array of additional parameters to pass along to the event handler. + */ + triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object; + + /** + * Remove a previously-attached event handler from the elements. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param handler The function that is to be no longer executed. + */ + unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove a previously-attached event handler from the elements. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). + */ + unbind(eventType: string, fls: boolean): JQuery; + /** + * Remove a previously-attached event handler from the elements. + * + * @param evt A JavaScript event object as passed to an event handler. + */ + unbind(evt: any): JQuery; + + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + */ + undelegate(): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" + * @param handler A function to execute at the time the event is triggered. + */ + undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param events An object of one or more event types and previously bound functions to unbind from them. + */ + undelegate(selector: string, events: Object): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param namespace A string containing a namespace to unbind all events from. + */ + undelegate(namespace: string): JQuery; + + /** + * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) + * + * @param handler A function to execute when the event is triggered. + */ + unload(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8) + * + * @param eventData A plain object of data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10) + */ + context: Element; + + jquery: string; + + /** + * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) + * + * @param handler A function to execute when the event is triggered. + */ + error(handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8) + * + * @param eventData A plain object of data that will be passed to the event handler. + * @param handler A function to execute when the event is triggered. + */ + error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Add a collection of DOM elements onto the jQuery stack. + * + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + */ + pushStack(elements: any[]): JQuery; + /** + * Add a collection of DOM elements onto the jQuery stack. + * + * @param elements An array of elements to push onto the stack and make into a new jQuery object. + * @param name The name of a jQuery method that generated the array of elements. + * @param arguments The arguments that were passed in to the jQuery method (for serialization). + */ + pushStack(elements: any[], name: string, arguments: any[]): JQuery; + + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements. + */ + after(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + after(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements. + */ + append(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. + */ + append(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert every element in the set of matched elements to the end of the target. + * + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter. + */ + appendTo(target: JQuery|any[]|Element|string): JQuery; + + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements. + */ + before(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + before(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Create a deep copy of the set of matched elements. + * + * param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. + * param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false). + */ + clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery; + + /** + * Remove the set of matched elements from the DOM. + * + * param selector A selector expression that filters the set of matched elements to be removed. + */ + detach(selector?: string): JQuery; + + /** + * Remove all child nodes of the set of matched elements from the DOM. + */ + empty(): JQuery; + + /** + * Insert every element in the set of matched elements after the target. + * + * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter. + */ + insertAfter(target: JQuery|any[]|Element|Text|string): JQuery; + + /** + * Insert every element in the set of matched elements before the target. + * + * param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter. + */ + insertBefore(target: JQuery|any[]|Element|Text|string): JQuery; + + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * + * param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements. + * param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements. + */ + prepend(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery; + /** + * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. + * + * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. + */ + prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery; + + /** + * Insert every element in the set of matched elements to the beginning of the target. + * + * @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter. + */ + prependTo(target: JQuery|any[]|Element|string): JQuery; + + /** + * Remove the set of matched elements from the DOM. + * + * @param selector A selector expression that filters the set of matched elements to be removed. + */ + remove(selector?: string): JQuery; + + /** + * Replace each target element with the set of matched elements. + * + * @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace. + */ + replaceAll(target: JQuery|any[]|Element|string): JQuery; + + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * + * param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object. + */ + replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery; + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * + * param func A function that returns content with which to replace the set of matched elements. + */ + replaceWith(func: () => Element|JQuery): JQuery; + + /** + * Get the combined text contents of each element in the set of matched elements, including their descendants. + */ + text(): string; + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation. + */ + text(text: string|number|boolean): JQuery; + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments. + */ + text(func: (index: number, text: string) => string): JQuery; + + /** + * Retrieve all the elements contained in the jQuery set, as an array. + */ + toArray(): any[]; + + /** + * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. + */ + unwrap(): JQuery; + + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + */ + wrap(wrappingElement: JQuery|Element|string): JQuery; + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + wrap(func: (index: number) => string|JQuery): JQuery; + + /** + * Wrap an HTML structure around all elements in the set of matched elements. + * + * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. + */ + wrapAll(wrappingElement: JQuery|Element|string): JQuery; + wrapAll(func: (index: number) => string): JQuery; + + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * + * @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements. + */ + wrapInner(wrappingElement: JQuery|Element|string): JQuery; + /** + * Wrap an HTML structure around the content of each element in the set of matched elements. + * + * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. + */ + wrapInner(func: (index: number) => string): JQuery; + + /** + * Iterate over a jQuery object, executing a function for each matched element. + * + * @param func A function to execute for each matched element. + */ + each(func: (index: number, elem: Element) => any): JQuery; + + /** + * Retrieve one of the elements matched by the jQuery object. + * + * @param index A zero-based integer indicating which element to retrieve. + */ + get(index: number): HTMLElement; + /** + * Retrieve the elements matched by the jQuery object. + */ + get(): any[]; + + /** + * Search for a given element from among the matched elements. + */ + index(): number; + /** + * Search for a given element from among the matched elements. + * + * @param selector A selector representing a jQuery collection in which to look for an element. + */ + index(selector: string|JQuery|Element): number; + + /** + * The number of elements in the jQuery object. + */ + length: number; + /** + * A selector representing selector passed to jQuery(), if any, when creating the original set. + * version deprecated: 1.7, removed: 1.9 + */ + selector: string; + [index: string]: any; + [index: number]: HTMLElement; + + /** + * Add elements to the set of matched elements. + * + * @param selector A string representing a selector expression to find additional elements to add to the set of matched elements. + * @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method. + */ + add(selector: string, context?: Element): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param elements One or more elements to add to the set of matched elements. + */ + add(...elements: Element[]): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param html An HTML fragment to add to the set of matched elements. + */ + add(html: string): JQuery; + /** + * Add elements to the set of matched elements. + * + * @param obj An existing jQuery object to add to the set of matched elements. + */ + add(obj: JQuery): JQuery; + + /** + * Get the children of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + children(selector?: string): JQuery; + + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + */ + closest(selector: string): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. + */ + closest(selector: string, context?: Element): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param obj A jQuery object to match elements against. + */ + closest(obj: JQuery): JQuery; + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * + * @param element An element to match elements against. + */ + closest(element: Element): JQuery; + + /** + * Get an array of all the elements and selectors matched against the current element up through the DOM tree. + * + * @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object). + * @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead. + */ + closest(selectors: any, context?: Element): any[]; + + /** + * Get the children of each element in the set of matched elements, including text and comment nodes. + */ + contents(): JQuery; + + /** + * End the most recent filtering operation in the current chain and return the set of matched elements to its previous state. + */ + end(): JQuery; + + /** + * Reduce the set of matched elements to the one at the specified index. + * + * @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set. + * + */ + eq(index: number): JQuery; + + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param selector A string containing a selector expression to match the current set of elements against. + */ + filter(selector: string): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param func A function used as a test for each element in the set. this is the current DOM element. + */ + filter(func: (index: number, element: Element) => any): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param element An element to match the current set of elements against. + */ + filter(element: Element): JQuery; + /** + * Reduce the set of matched elements to those that match the selector or pass the function's test. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ + filter(obj: JQuery): JQuery; + + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param selector A string containing a selector expression to match elements against. + */ + find(selector: string): JQuery; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param element An element to match elements against. + */ + find(element: Element): JQuery; + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element. + * + * @param obj A jQuery object to match elements against. + */ + find(obj: JQuery): JQuery; + + /** + * Reduce the set of matched elements to the first in the set. + */ + first(): JQuery; + + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + */ + has(selector: string): JQuery; + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param contained A DOM element to match elements against. + */ + has(contained: Element): JQuery; + + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + */ + is(selector: string): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. + */ + is(func: (index: number, element: Element) => boolean): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ + is(obj: JQuery): boolean; + /** + * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. + * + * @param elements One or more elements to match the current set of elements against. + */ + is(elements: any): boolean; + + /** + * Reduce the set of matched elements to the final one in the set. + */ + last(): JQuery; + + /** + * Pass each element in the current matched set through a function, producing a new jQuery object containing the return values. + * + * @param callback A function object that will be invoked for each element in the current set. + */ + map(callback: (index: number, domElement: Element) => any): JQuery; + + /** + * Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + next(selector?: string): JQuery; + + /** + * Get all following siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + nextAll(selector?: string): JQuery; + + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param selector A string containing a selector expression to indicate where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + nextUntil(selector?: string, filter?: string): JQuery; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param element A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + nextUntil(element?: Element, filter?: string): JQuery; + /** + * Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed. + * + * @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + nextUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Remove elements from the set of matched elements. + * + * @param selector A string containing a selector expression to match elements against. + */ + not(selector: string): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param func A function used as a test for each element in the set. this is the current DOM element. + */ + not(func: (index: number, element: Element) => boolean): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param elements One or more DOM elements to remove from the matched set. + */ + not(...elements: Element[]): JQuery; + /** + * Remove elements from the set of matched elements. + * + * @param obj An existing jQuery object to match the current set of elements against. + */ + not(obj: JQuery): JQuery; + + /** + * Get the closest ancestor element that is positioned. + */ + offsetParent(): JQuery; + + /** + * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + parent(selector?: string): JQuery; + + /** + * Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + parents(selector?: string): JQuery; + + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param selector A string containing a selector expression to indicate where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ + parentsUntil(selector?: string, filter?: string): JQuery; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param element A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ + parentsUntil(element?: Element, filter?: string): JQuery; + /** + * Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements. + * @param filter A string containing a selector expression to match elements against. + */ + parentsUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + prev(selector?: string): JQuery; + + /** + * Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + prevAll(selector?: string): JQuery; + + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + prevUntil(selector?: string, filter?: string): JQuery; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + prevUntil(element?: Element, filter?: string): JQuery; + /** + * Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object. + * + * @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements. + * @param filter A string containing a selector expression to match elements against. + */ + prevUntil(obj?: JQuery, filter?: string): JQuery; + + /** + * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + */ + siblings(selector?: string): JQuery; + + /** + * Reduce the set of matched elements to a subset specified by a range of indices. + * + * @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set. + * @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set. + */ + slice(start: number, end?: number): JQuery; + + /** + * Show the queue of functions to be executed on the matched elements. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + */ + queue(queueName?: string): any[]; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. + */ + queue(callback: Function): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param newQueue An array of functions to replace the current queue contents. + */ + queue(queueName: string, newQueue: Function[]): JQuery; + /** + * Manipulate the queue of functions to be executed, once for each matched element. + * + * @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue. + * @param callback The new function to add to the queue, with a function to call that will dequeue the next item. + */ + queue(queueName: string, callback: Function): JQuery; +} +declare module "jquery" { + export = $; +} +declare var jQuery: JQueryStatic; +declare var $: JQueryStatic; diff --git a/src/Jackett.Web/Scripts/typings/moment/moment-node.d.ts b/src/Jackett.Web/Scripts/typings/moment/moment-node.d.ts new file mode 100644 index 000000000..969e9dd9f --- /dev/null +++ b/src/Jackett.Web/Scripts/typings/moment/moment-node.d.ts @@ -0,0 +1,479 @@ +// Type definitions for Moment.js 2.8.0 +// Project: https://github.com/timrwood/moment +// Definitions by: Michael Lakerveld , Aaron King , Hiroki Horiuchi , Dick van den Brink , Adi Dahiya , Matt Brooks +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module moment { + + interface MomentInput { + + /** Year */ + years?: number; + /** Year */ + year?: number; + /** Year */ + y?: number; + + /** Month */ + months?: number; + /** Month */ + month?: number; + /** Month */ + M?: number; + + /** Day/Date */ + days?: number; + /** Day/Date */ + day?: number; + /** Day/Date */ + date?: number; + /** Day/Date */ + d?: number; + + /** Hour */ + hours?: number; + /** Hour */ + hour?: number; + /** Hour */ + h?: number; + + /** Minute */ + minutes?: number; + /** Minute */ + minute?: number; + /** Minute */ + m?: number; + + /** Second */ + seconds?: number; + /** Second */ + second?: number; + /** Second */ + s?: number; + + /** Millisecond */ + milliseconds?: number; + /** Millisecond */ + millisecond?: number; + /** Millisecond */ + ms?: number; + + } + + interface Duration { + + humanize(withSuffix?: boolean): string; + + as(units: string): number; + + milliseconds(): number; + asMilliseconds(): number; + + seconds(): number; + asSeconds(): number; + + minutes(): number; + asMinutes(): number; + + hours(): number; + asHours(): number; + + days(): number; + asDays(): number; + + months(): number; + asMonths(): number; + + years(): number; + asYears(): number; + + add(n: number, p: string): Duration; + add(n: number): Duration; + add(d: Duration): Duration; + + subtract(n: number, p: string): Duration; + subtract(n: number): Duration; + subtract(d: Duration): Duration; + + toISOString(): string; + toJSON(): string; + + } + + interface Moment { + + format(format: string): string; + format(): string; + + fromNow(withoutSuffix?: boolean): string; + + startOf(unitOfTime: string): Moment; + endOf(unitOfTime: string): Moment; + + /** + * Mutates the original moment by adding time. (deprecated in 2.8.0) + * + * @param unitOfTime the unit of time you want to add (eg "years" / "hours" etc) + * @param amount the amount you want to add + */ + add(unitOfTime: string, amount: number): Moment; + /** + * Mutates the original moment by adding time. + * + * @param amount the amount you want to add + * @param unitOfTime the unit of time you want to add (eg "years" / "hours" etc) + */ + add(amount: number, unitOfTime: string): Moment; + /** + * Mutates the original moment by adding time. Note that the order of arguments can be flipped. + * + * @param amount the amount you want to add + * @param unitOfTime the unit of time you want to add (eg "years" / "hours" etc) + */ + add(amount: string, unitOfTime: string): Moment; + /** + * Mutates the original moment by adding time. + * + * @param objectLiteral an object literal that describes multiple time units {days:7,months:1} + */ + add(objectLiteral: MomentInput): Moment; + /** + * Mutates the original moment by adding time. + * + * @param duration a length of time + */ + add(duration: Duration): Moment; + + /** + * Mutates the original moment by subtracting time. (deprecated in 2.8.0) + * + * @param unitOfTime the unit of time you want to subtract (eg "years" / "hours" etc) + * @param amount the amount you want to subtract + */ + subtract(unitOfTime: string, amount: number): Moment; + /** + * Mutates the original moment by subtracting time. + * + * @param unitOfTime the unit of time you want to subtract (eg "years" / "hours" etc) + * @param amount the amount you want to subtract + */ + subtract(amount: number, unitOfTime: string): Moment; + /** + * Mutates the original moment by subtracting time. Note that the order of arguments can be flipped. + * + * @param amount the amount you want to add + * @param unitOfTime the unit of time you want to subtract (eg "years" / "hours" etc) + */ + subtract(amount: string, unitOfTime: string): Moment; + /** + * Mutates the original moment by subtracting time. + * + * @param objectLiteral an object literal that describes multiple time units {days:7,months:1} + */ + subtract(objectLiteral: MomentInput): Moment; + /** + * Mutates the original moment by subtracting time. + * + * @param duration a length of time + */ + subtract(duration: Duration): Moment; + + calendar(): string; + calendar(start: Moment): string; + + clone(): Moment; + + /** + * @return Unix timestamp, or milliseconds since the epoch. + */ + valueOf(): number; + + local(): Moment; // current date/time in local mode + + utc(): Moment; // current date/time in UTC mode + + isValid(): boolean; + invalidAt(): number; + + year(y: number): Moment; + year(): number; + quarter(): number; + quarter(q: number): Moment; + month(M: number): Moment; + month(M: string): Moment; + month(): number; + day(d: number): Moment; + day(d: string): Moment; + day(): number; + date(d: number): Moment; + date(): number; + hour(h: number): Moment; + hour(): number; + hours(h: number): Moment; + hours(): number; + minute(m: number): Moment; + minute(): number; + minutes(m: number): Moment; + minutes(): number; + second(s: number): Moment; + second(): number; + seconds(s: number): Moment; + seconds(): number; + millisecond(ms: number): Moment; + millisecond(): number; + milliseconds(ms: number): Moment; + milliseconds(): number; + weekday(): number; + weekday(d: number): Moment; + isoWeekday(): number; + isoWeekday(d: number): Moment; + weekYear(): number; + weekYear(d: number): Moment; + isoWeekYear(): number; + isoWeekYear(d: number): Moment; + week(): number; + week(d: number): Moment; + weeks(): number; + weeks(d: number): Moment; + isoWeek(): number; + isoWeek(d: number): Moment; + isoWeeks(): number; + isoWeeks(d: number): Moment; + weeksInYear(): number; + isoWeeksInYear(): number; + dayOfYear(): number; + dayOfYear(d: number): Moment; + + from(f: Moment|string|number|Date|number[], suffix?: boolean): string; + to(f: Moment|string|number|Date|number[], suffix?: boolean): string; + + diff(b: Moment): number; + diff(b: Moment, unitOfTime: string): number; + diff(b: Moment, unitOfTime: string, round: boolean): number; + + toArray(): number[]; + toDate(): Date; + toISOString(): string; + toJSON(): string; + unix(): number; + + isLeapYear(): boolean; + zone(): number; + zone(b: number): Moment; + zone(b: string): Moment; + utcOffset(): number; + utcOffset(b: number): Moment; + utcOffset(b: string): Moment; + daysInMonth(): number; + isDST(): boolean; + + isBefore(): boolean; + isBefore(b: Moment|string|number|Date|number[], granularity?: string): boolean; + + isAfter(): boolean; + isAfter(b: Moment|string|number|Date|number[], granularity?: string): boolean; + + isSame(b: Moment|string|number|Date|number[], granularity?: string): boolean; + isBetween(a: Moment|string|number|Date|number[], b: Moment|string|number|Date|number[], granularity?: string): boolean; + + // Deprecated as of 2.8.0. + lang(language: string): Moment; + lang(reset: boolean): Moment; + lang(): MomentLanguage; + + locale(language: string): Moment; + locale(reset: boolean): Moment; + locale(): string; + + localeData(language: string): Moment; + localeData(reset: boolean): Moment; + localeData(): MomentLanguage; + + // Deprecated as of 2.7.0. + max(date: Moment|string|number|Date|any[]): Moment; + max(date: string, format: string): Moment; + + // Deprecated as of 2.7.0. + min(date: Moment|string|number|Date|any[]): Moment; + min(date: string, format: string): Moment; + + get(unit: string): number; + set(unit: string, value: number): Moment; + + } + + interface MomentCalendar { + + lastDay: any; + sameDay: any; + nextDay: any; + lastWeek: any; + nextWeek: any; + sameElse: any; + + } + + interface BaseMomentLanguage { + months ?: any; + monthsShort ?: any; + weekdays ?: any; + weekdaysShort ?: any; + weekdaysMin ?: any; + relativeTime ?: MomentRelativeTime; + meridiem ?: (hour: number, minute: number, isLowercase: boolean) => string; + calendar ?: MomentCalendar; + ordinal ?: (num: number) => string; + } + + interface MomentLanguage extends BaseMomentLanguage { + longDateFormat?: MomentLongDateFormat; + } + + interface MomentLanguageData extends BaseMomentLanguage { + /** + * @param formatType should be L, LL, LLL, LLLL. + */ + longDateFormat(formatType: string): string; + } + + interface MomentLongDateFormat { + + L: string; + LL: string; + LLL: string; + LLLL: string; + LT: string; + l?: string; + ll?: string; + lll?: string; + llll?: string; + lt?: string; + + } + + interface MomentRelativeTime { + + future: any; + past: any; + s: any; + m: any; + mm: any; + h: any; + hh: any; + d: any; + dd: any; + M: any; + MM: any; + y: any; + yy: any; + + } + + interface MomentStatic { + + version: string; + fn: Moment; + + (): Moment; + (date: number): Moment; + (date: number[]): Moment; + (date: string, format?: string, strict?: boolean): Moment; + (date: string, format?: string, language?: string, strict?: boolean): Moment; + (date: string, formats: string[], strict?: boolean): Moment; + (date: string, formats: string[], language?: string, strict?: boolean): Moment; + (date: string, specialFormat: () => void, strict?: boolean): Moment; + (date: string, specialFormat: () => void, language?: string, strict?: boolean): Moment; + (date: string, formatsIncludingSpecial: any[], strict?: boolean): Moment; + (date: string, formatsIncludingSpecial: any[], language?: string, strict?: boolean): Moment; + (date: Date): Moment; + (date: Moment): Moment; + (date: Object): Moment; + + utc(): Moment; + utc(date: number): Moment; + utc(date: number[]): Moment; + utc(date: string, format?: string, strict?: boolean): Moment; + utc(date: string, format?: string, language?: string, strict?: boolean): Moment; + utc(date: string, formats: string[], strict?: boolean): Moment; + utc(date: string, formats: string[], language?: string, strict?: boolean): Moment; + utc(date: Date): Moment; + utc(date: Moment): Moment; + utc(date: Object): Moment; + + unix(timestamp: number): Moment; + + invalid(parsingFlags?: Object): Moment; + isMoment(): boolean; + isMoment(m: any): boolean; + isDate(m: any): boolean; + isDuration(): boolean; + isDuration(d: any): boolean; + + // Deprecated in 2.8.0. + lang(language?: string): string; + lang(language?: string, definition?: MomentLanguage): string; + + locale(language?: string): string; + locale(language?: string[]): string; + locale(language?: string, definition?: MomentLanguage): string; + + localeData(language?: string): MomentLanguageData; + + longDateFormat: any; + relativeTime: any; + meridiem: (hour: number, minute: number, isLowercase: boolean) => string; + calendar: any; + ordinal: (num: number) => string; + + duration(milliseconds: Number): Duration; + duration(num: Number, unitOfTime: string): Duration; + duration(input: MomentInput): Duration; + duration(object: any): Duration; + duration(): Duration; + + parseZone(date: string): Moment; + + months(): string[]; + months(index: number): string; + months(format: string): string[]; + months(format: string, index: number): string; + monthsShort(): string[]; + monthsShort(index: number): string; + monthsShort(format: string): string[]; + monthsShort(format: string, index: number): string; + + weekdays(): string[]; + weekdays(index: number): string; + weekdays(format: string): string[]; + weekdays(format: string, index: number): string; + weekdaysShort(): string[]; + weekdaysShort(index: number): string; + weekdaysShort(format: string): string[]; + weekdaysShort(format: string, index: number): string; + weekdaysMin(): string[]; + weekdaysMin(index: number): string; + weekdaysMin(format: string): string[]; + weekdaysMin(format: string, index: number): string; + + min(moments: Moment[]): Moment; + max(moments: Moment[]): Moment; + + normalizeUnits(unit: string): string; + relativeTimeThreshold(threshold: string): number|boolean; + relativeTimeThreshold(threshold: string, limit:number): boolean; + + /** + * Constant used to enable explicit ISO_8601 format parsing. + */ + ISO_8601(): void; + + defaultFormat: string; + + } + +} + +declare module 'moment' { + var moment: moment.MomentStatic; + export default moment; +} \ No newline at end of file diff --git a/src/Jackett.Web/Scripts/typings/moment/moment.d.ts b/src/Jackett.Web/Scripts/typings/moment/moment.d.ts new file mode 100644 index 000000000..78b09016c --- /dev/null +++ b/src/Jackett.Web/Scripts/typings/moment/moment.d.ts @@ -0,0 +1,8 @@ +// Type definitions for Moment.js 2.8.0 +// Project: https://github.com/timrwood/moment +// Definitions by: Michael Lakerveld , Aaron King , Hiroki Horiuchi , Dick van den Brink , Adi Dahiya , Matt Brooks +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare var moment: moment.MomentStatic; diff --git a/src/Jackett.Web/Scripts/typings/signalr/signalr.d.ts b/src/Jackett.Web/Scripts/typings/signalr/signalr.d.ts new file mode 100644 index 000000000..aa17d1e57 --- /dev/null +++ b/src/Jackett.Web/Scripts/typings/signalr/signalr.d.ts @@ -0,0 +1,112 @@ +// Type definitions for SignalR 1.0 +// Project: http://www.asp.net/signalr +// Definitions by: Boris Yankov , T. Michael Keesey +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + +interface HubMethod { + (callback: (data: string) => void ): any; +} + +interface SignalREvents { + onStart: string; + onStarting: string; + onReceived: string; + onError: string; + onConnectionSlow: string; + onReconnect: string; + onStateChanged: string; + onDisconnect: string; +} + +interface SignalRStateChange { + oldState: number; + newState: number; +} + +interface SignalR { + events: SignalREvents; + connectionState: any; + transports: any; + + hub: HubConnection; + id: string; + logging: boolean; + messageId: string; + url: string; + qs: any; + state: number; + + (url: string, queryString?: any, logging?: boolean): SignalR; + hubConnection(url?: string): SignalR; + + log(msg: string, logging: boolean): void; + isCrossDomain(url: string): boolean; + changeState(connection: SignalR, expectedState: number, newState: number): boolean; + isDisconnecting(connection: SignalR): boolean; + + // createHubProxy(hubName: string): SignalR; + + start(): JQueryPromise; + start(callback: () => void ): JQueryPromise; + start(settings: ConnectionSettings): JQueryPromise; + start(settings: ConnectionSettings, callback: () => void ): JQueryPromise; + + + send(data: string): void; + stop(async?: boolean, notifyServer?: boolean): void; + + starting(handler: () => void ): SignalR; + received(handler: (data: any) => void ): SignalR; + error(handler: (error: string) => void ): SignalR; + stateChanged(handler: (change: SignalRStateChange) => void ): SignalR; + disconnected(handler: () => void ): SignalR; + connectionSlow(handler: () => void ): SignalR; + sending(handler: () => void ): SignalR; + reconnecting(handler: () => void): SignalR; + reconnected(handler: () => void): SignalR; +} + +interface HubProxy { + (connection: HubConnection, hubName: string): HubProxy; + state: any; + connection: HubConnection; + hubName: string; + init(connection: HubConnection, hubName: string): void; + hasSubscriptions(): boolean; + on(eventName: string, callback: (...msg: any[]) => void ): HubProxy; + off(eventName: string, callback: (msg: any) => void ): HubProxy; + invoke(methodName: string, ...args: any[]): JQueryDeferred; +} + +interface HubConnectionSettings { + queryString?: string; + logging?: boolean; + useDefaultPath?: boolean; +} + +interface HubConnection extends SignalR { + //(url?: string, queryString?: any, logging?: boolean): HubConnection; + proxies: any; + received(callback: (data: { Id: any; Method: any; Hub: any; State: any; Args: any; }) => void ): HubConnection; + createHubProxy(hubName: string): HubProxy; +} + +interface SignalRfn { + init(url: any, qs: any, logging: any): any; +} + +interface ConnectionSettings { + transport?: any; + callback?: any; + waitForPageLoad?: boolean; + jsonp?: boolean; +} + +interface JQueryStatic { + signalR: SignalR; + connection: SignalR; + hubConnection(url?: string, options?: HubConnectionSettings): HubConnection; +} diff --git a/src/Jackett.Web/Services/AutoDLService.js b/src/Jackett.Web/Services/AutoDLService.js new file mode 100644 index 000000000..3ebf7de07 --- /dev/null +++ b/src/Jackett.Web/Services/AutoDLService.js @@ -0,0 +1,34 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +import { WebClient } from '../Services/WebClient'; +import { autoinject } from 'aurelia-framework'; +export let AutoDLService = class { + constructor(httpClient) { + this.webClient = httpClient; + } + getProfiles() { + return this.webClient.get('AutoDL') + .then(response => { return JSON.parse(response.response); }); + } + saveProfile(profile) { + return this.webClient.put('AutoDL', profile); + } +}; +AutoDLService = __decorate([ + autoinject, + __metadata('design:paramtypes', [WebClient]) +], AutoDLService); +export class AutoDLConfigOption { +} +export class AutoDLProfile { +} +//# sourceMappingURL=AutoDLService.js.map \ No newline at end of file diff --git a/src/Jackett.Web/Services/AutoDLService.js.map b/src/Jackett.Web/Services/AutoDLService.js.map new file mode 100644 index 000000000..daab91990 --- /dev/null +++ b/src/Jackett.Web/Services/AutoDLService.js.map @@ -0,0 +1 @@ +{"version":3,"file":"AutoDLService.js","sourceRoot":"","sources":["AutoDLService.ts"],"names":["AutoDLService","AutoDLService.constructor","AutoDLService.getProfiles","AutoDLService.saveProfile","AutoDLConfigOption","AutoDLProfile"],"mappings":";;;;;;;;;;;OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB;OACxC,EAAC,UAAU,EAAC,MAAM,mBAAmB;AAE5C;IAIIA,YAAYA,UAAqBA;QAC7BC,IAAIA,CAACA,SAASA,GAAGA,UAAUA,CAACA;IAChCA,CAACA;IAEDD,WAAWA;QACPE,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,GAAGA,CAACA,QAAQA,CAACA;aAC9BA,IAAIA,CAACA,QAAQA,MAAMA,MAAMA,CAACA,IAAIA,CAACA,KAAKA,CAACA,QAAQA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;IACrEA,CAACA;IAEDF,WAAWA,CAACA,OAAsBA;QAC9BG,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,GAAGA,CAACA,QAAQA,EAAEA,OAAOA,CAACA,CAACA;IACjDA,CAACA;AACLH,CAACA;AAhBD;IAAC,UAAU;;kBAgBV;AAED;AAaAI,CAACA;AAED;AAMAC,CAACA;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/Services/AutoDLService.ts b/src/Jackett.Web/Services/AutoDLService.ts new file mode 100644 index 000000000..852ca0405 --- /dev/null +++ b/src/Jackett.Web/Services/AutoDLService.ts @@ -0,0 +1,43 @@ +import {WebClient} from '../Services/WebClient'; +import {autoinject} from 'aurelia-framework'; + +@autoinject +export class AutoDLService { + webClient: WebClient; + + constructor(httpClient: WebClient) { + this.webClient = httpClient; + } + + getProfiles(): Promise { + return this.webClient.get('AutoDL') + .then(response => { return JSON.parse(response.response); }); + } + + saveProfile(profile: AutoDLProfile): Promise { + return this.webClient.put('AutoDL', profile); + } +} + +export class AutoDLConfigOption { + Name: string; + Label: string; + Type: string; + Value: any; + DefaultValue: string; + EmptyText: string; + Tooltip: string; + PasteGroup: string; + PasteRegex: string; + MinValue: string; + MaxValue: string; + IsDownloadVar: boolean; +} + +export class AutoDLProfile { + Type: string; + ShortName: string; + LongName: string; + SiteName: string; + Options: AutoDLConfigOption[]; +} diff --git a/src/Jackett.Web/Services/IRCProfileService.js b/src/Jackett.Web/Services/IRCProfileService.js new file mode 100644 index 000000000..b84e25e00 --- /dev/null +++ b/src/Jackett.Web/Services/IRCProfileService.js @@ -0,0 +1,45 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +import { WebClient } from '../Services/WebClient'; +import { autoinject } from 'aurelia-framework'; +export let IRCProfileService = class { + constructor(httpClient) { + this.webClient = httpClient; + } + getAutoDLProfiles() { + return this.webClient.get('AutoDL/Summary') + .then(response => { return JSON.parse(response.response); }); + } + getProfiles() { + return this.webClient.get('IRCProfile') + .then(response => { return JSON.parse(response.response); }); + } + getProfile(name) { + return this.webClient.get('IRCProfile/' + name) + .then(response => { return JSON.parse(response.response); }); + } + setProfile(profile) { + return this.webClient.put('IRCProfile', profile); + } + removeProfile(profile) { + return this.webClient.delete('IRCProfile/' + profile.Id); + } +}; +IRCProfileService = __decorate([ + autoinject, + __metadata('design:paramtypes', [WebClient]) +], IRCProfileService); +export class NetworkSummary { +} +export class IRCProfile { +} +//# sourceMappingURL=IRCProfileService.js.map \ No newline at end of file diff --git a/src/Jackett.Web/Services/IRCProfileService.js.map b/src/Jackett.Web/Services/IRCProfileService.js.map new file mode 100644 index 000000000..7de3a0c5d --- /dev/null +++ b/src/Jackett.Web/Services/IRCProfileService.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IRCProfileService.js","sourceRoot":"","sources":["IRCProfileService.ts"],"names":["IRCProfileService","IRCProfileService.constructor","IRCProfileService.getAutoDLProfiles","IRCProfileService.getProfiles","IRCProfileService.getProfile","IRCProfileService.setProfile","IRCProfileService.removeProfile","NetworkSummary","IRCProfile"],"mappings":";;;;;;;;;;;OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB;OACxC,EAAC,UAAU,EAAC,MAAM,mBAAmB;AAE5C;IAIIA,YAAYA,UAAqBA;QAC7BC,IAAIA,CAACA,SAASA,GAAGA,UAAUA,CAACA;IAChCA,CAACA;IAEDD,iBAAiBA;QACbE,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,GAAGA,CAACA,gBAAgBA,CAACA;aACtCA,IAAIA,CAACA,QAAQA,MAAMA,MAAMA,CAACA,IAAIA,CAACA,KAAKA,CAACA,QAAQA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;IACrEA,CAACA;IAEDF,WAAWA;QACPG,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,GAAGA,CAACA,YAAYA,CAACA;aAClCA,IAAIA,CAACA,QAAQA,MAAMA,MAAMA,CAACA,IAAIA,CAACA,KAAKA,CAACA,QAAQA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;IACrEA,CAACA;IAEDH,UAAUA,CAACA,IAAYA;QACnBI,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,GAAGA,CAACA,aAAaA,GAAGA,IAAIA,CAACA;aAC1CA,IAAIA,CAACA,QAAQA,MAAMA,MAAMA,CAACA,IAAIA,CAACA,KAAKA,CAACA,QAAQA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;IACrEA,CAACA;IAEDJ,UAAUA,CAACA,OAAmBA;QAC1BK,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,GAAGA,CAACA,YAAYA,EAAEA,OAAOA,CAACA,CAACA;IACrDA,CAACA;IAEDL,aAAaA,CAACA,OAAmBA;QAC7BM,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA,aAAaA,GAAGA,OAAOA,CAACA,EAAEA,CAACA,CAACA;IAC7DA,CAACA;AACLN,CAACA;AA9BD;IAAC,UAAU;;sBA8BV;AAGD;AAIAO,CAACA;AAED;AAMAC,CAACA;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/Services/IRCProfileService.ts b/src/Jackett.Web/Services/IRCProfileService.ts new file mode 100644 index 000000000..bedb82cd7 --- /dev/null +++ b/src/Jackett.Web/Services/IRCProfileService.ts @@ -0,0 +1,49 @@ +import {WebClient} from '../Services/WebClient'; +import {autoinject} from 'aurelia-framework'; + +@autoinject +export class IRCProfileService { + webClient: WebClient; + + constructor(httpClient: WebClient) { + this.webClient = httpClient; + } + + getAutoDLProfiles(): Promise { + return this.webClient.get('AutoDL/Summary') + .then(response => { return JSON.parse(response.response); }); + } + + getProfiles(): Promise { + return this.webClient.get('IRCProfile') + .then(response => { return JSON.parse(response.response); }); + } + + getProfile(name: string): Promise { + return this.webClient.get('IRCProfile/' + name) + .then(response => { return JSON.parse(response.response); }); + } + + setProfile(profile: IRCProfile): Promise { + return this.webClient.put('IRCProfile', profile); + } + + removeProfile(profile: IRCProfile): Promise { + return this.webClient.delete('IRCProfile/' + profile.Id); + } +} + + +export class NetworkSummary { + Name: string; + Servers: string[]; + Profiles: string[]; +} + +export class IRCProfile { + Id: string; + Name: string; + Servers: string[]; + Username: string; + Profile: string; +} \ No newline at end of file diff --git a/src/Jackett.Web/Services/IRCService.js b/src/Jackett.Web/Services/IRCService.js new file mode 100644 index 000000000..74cc3b176 --- /dev/null +++ b/src/Jackett.Web/Services/IRCService.js @@ -0,0 +1,56 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +import { WebClient } from '../Services/WebClient'; +import { autoinject } from 'aurelia-framework'; +export let IRCService = class { + constructor(httpClient) { + this.webClient = httpClient; + } + getState() { + return this.webClient.get('ircstate') + .then(response => { return JSON.parse(response.response); }); + } + getMessages(networkId, roomId) { + var url = 'ircmessages/' + networkId; + if (roomId !== null) { + url += '/' + roomId; + } + return this.webClient.get(url) + .then(response => { + var messages = JSON.parse(response.response); + messages.forEach(m => { + // m.Text = m.Text.replace('\n', '
'); + }); + return messages; + }); + } + getUsers(networkId, roomId) { + return this.webClient.get('ircusers/' + networkId + '/' + roomId) + .then(response => { return JSON.parse(response.response); }); + } + processCommand(networkId, roomId, command) { + return this.webClient.post('irccommand', { Text: command, NetworkId: networkId, ChannelId: roomId }); + } +}; +IRCService = __decorate([ + autoinject, + __metadata('design:paramtypes', [WebClient]) +], IRCService); +export class NetworkState { +} +export class ChannelState { +} +export class IRCMessage { +} +export class IRCUser { +} +//# sourceMappingURL=IRCService.js.map \ No newline at end of file diff --git a/src/Jackett.Web/Services/IRCService.js.map b/src/Jackett.Web/Services/IRCService.js.map new file mode 100644 index 000000000..bb12639e7 --- /dev/null +++ b/src/Jackett.Web/Services/IRCService.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IRCService.js","sourceRoot":"","sources":["IRCService.ts"],"names":["IRCService","IRCService.constructor","IRCService.getState","IRCService.getMessages","IRCService.getUsers","IRCService.processCommand","NetworkState","ChannelState","IRCMessage","IRCUser"],"mappings":";;;;;;;;;;;OAAO,EAAC,SAAS,EAAC,MAAM,uBAAuB;OACxC,EAAC,UAAU,EAAC,MAAM,mBAAmB;AAE5C;IAIIA,YAAYA,UAAqBA;QAC7BC,IAAIA,CAACA,SAASA,GAAGA,UAAUA,CAACA;IAChCA,CAACA;IAEDD,QAAQA;QACJE,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,GAAGA,CAACA,UAAUA,CAACA;aAChCA,IAAIA,CAACA,QAAQA,MAAMA,MAAMA,CAACA,IAAIA,CAACA,KAAKA,CAACA,QAAQA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;IACrEA,CAACA;IAEDF,WAAWA,CAACA,SAAiBA,EAAEA,MAAcA;QACzCG,IAAIA,GAAGA,GAAGA,cAAcA,GAAGA,SAASA,CAACA;QACrCA,EAAEA,CAACA,CAACA,MAAMA,KAAKA,IAAIA,CAACA,CAACA,CAACA;YAClBA,GAAGA,IAAIA,GAAGA,GAAGA,MAAMA,CAACA;QACxBA,CAACA;QAEDA,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,GAAGA,CAACA,GAAGA,CAACA;aACzBA,IAAIA,CAACA,QAAQA;YACVA,IAAIA,QAAQA,GAAGA,IAAIA,CAACA,KAAKA,CAACA,QAAQA,CAACA,QAAQA,CAACA,CAACA;YAC7CA,QAAQA,CAACA,OAAOA,CAACA,CAACA;gBACfA,2CAA2CA;YAC9CA,CAACA,CAACA,CAACA;YACHA,MAAMA,CAACA,QAAQA,CAACA;QACpBA,CAACA,CAACA,CAACA;IACXA,CAACA;IAEDH,QAAQA,CAACA,SAAiBA,EAAEA,MAAcA;QACtCI,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,GAAGA,CAACA,WAAWA,GAAGA,SAASA,GAAGA,GAAGA,GAAGA,MAAMA,CAACA;aAC5DA,IAAIA,CAACA,QAAQA,MAAMA,MAAMA,CAACA,IAAIA,CAACA,KAAKA,CAACA,QAAQA,CAACA,QAAQA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;IACrEA,CAACA;IAEDJ,cAAcA,CAACA,SAAiBA,EAAEA,MAAcA,EAAEA,OAAeA;QAC7DK,MAAMA,CAACA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,YAAYA,EAAEA,EAAEA,IAAIA,EAAEA,OAAOA,EAAEA,SAASA,EAAEA,SAASA,EAAEA,SAASA,EAAEA,MAAMA,EAAEA,CAACA,CAACA;IACzGA,CAACA;AACLL,CAACA;AArCD;IAAC,UAAU;;eAqCV;AAED;AAKAM,CAACA;AAED;AAIAC,CAACA;AAED;AAKAC,CAACA;AAED;AAEAC,CAACA;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/Services/IRCService.ts b/src/Jackett.Web/Services/IRCService.ts new file mode 100644 index 000000000..60a49c547 --- /dev/null +++ b/src/Jackett.Web/Services/IRCService.ts @@ -0,0 +1,65 @@ +import {WebClient} from '../Services/WebClient'; +import {autoinject} from 'aurelia-framework'; + +@autoinject +export class IRCService { + webClient: WebClient; + + constructor(httpClient: WebClient) { + this.webClient = httpClient; + } + + getState(): Promise { + return this.webClient.get('ircstate') + .then(response => { return JSON.parse(response.response); }); + } + + getMessages(networkId: string, roomId: string): Promise { + var url = 'ircmessages/' + networkId; + if (roomId !== null) { + url += '/' + roomId; + } + + return this.webClient.get(url) + .then(response => { + var messages = JSON.parse(response.response); + messages.forEach(m=> { + // m.Text = m.Text.replace('\n', '
'); + }); + return messages; + }); + } + + getUsers(networkId: string, roomId: string): Promise { + return this.webClient.get('ircusers/' + networkId + '/' + roomId) + .then(response => { return JSON.parse(response.response); }); + } + + processCommand(networkId: string, roomId: string, command: string) { + return this.webClient.post('irccommand', { Text: command, NetworkId: networkId, ChannelId: roomId }); + } +} + +export class NetworkState { + Id: string; + Name: string; + Channels: ChannelState[]; + IsSelected: boolean; +} + +export class ChannelState { + Id: string; + Name: string; + IsSelected: boolean; +} + +export class IRCMessage { + Text: string; + When: Date; + From: string; + Type: number; +} + +export class IRCUser { + Nickname: string; +} \ No newline at end of file diff --git a/src/Jackett.Web/Services/SignalRService.js b/src/Jackett.Web/Services/SignalRService.js new file mode 100644 index 000000000..2864d108f --- /dev/null +++ b/src/Jackett.Web/Services/SignalRService.js @@ -0,0 +1,42 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +import { autoinject } from 'aurelia-framework'; +import { EventAggregator } from 'aurelia-event-aggregator'; +import 'jquery'; +import 'ms-signalr-client'; +import 'jackett-hubs'; +export let SignalRService = class { + constructor(ea) { + this.aggregator = ea; + } + start() { + let hub = $.connection.hub.proxies.jacketthubproxy; + hub.client.onEvent = (e, d) => { + this.onEvent(e, d); + }; + $.connection.hub.start().done(() => { + console.log('Jackett SignalR connected'); + }); + $.connection.hub.disconnected(() => { + console.log('Jackett SignalR disconnected'); + }); + } + onEvent(type, data) { + debugger; + this.aggregator.publish(type, data); + } +}; +SignalRService = __decorate([ + autoinject, + __metadata('design:paramtypes', [EventAggregator]) +], SignalRService); +//# sourceMappingURL=SignalRService.js.map \ No newline at end of file diff --git a/src/Jackett.Web/Services/SignalRService.js.map b/src/Jackett.Web/Services/SignalRService.js.map new file mode 100644 index 000000000..107ae0d61 --- /dev/null +++ b/src/Jackett.Web/Services/SignalRService.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SignalRService.js","sourceRoot":"","sources":["SignalRService.ts"],"names":["SignalRService","SignalRService.constructor","SignalRService.start","SignalRService.onEvent"],"mappings":";;;;;;;;;;;OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB;OACrC,EAAC,eAAe,EAAC,MAAM,0BAA0B;OACjD,QAAQ;OACR,mBAAmB;OACnB,cAAc;AAGrB;IAIIA,YAAYA,EAAmBA;QAC3BC,IAAIA,CAACA,UAAUA,GAAGA,EAAEA,CAACA;IACzBA,CAACA;IAEDD,KAAKA;QACDE,IAAIA,GAAGA,GAAGA,CAACA,CAACA,UAAUA,CAACA,GAAGA,CAACA,OAAOA,CAACA,eAAeA,CAACA;QACnDA,GAAGA,CAACA,MAAMA,CAACA,OAAOA,GAAGA,CAACA,CAACA,EAAEA,CAACA;YACtBA,IAAIA,CAACA,OAAOA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA;QACvBA,CAACA,CAACA;QAEFA,CAACA,CAACA,UAAUA,CAACA,GAAGA,CAACA,KAAKA,EAAEA,CAACA,IAAIA,CAACA;YAC1BA,OAAOA,CAACA,GAAGA,CAACA,2BAA2BA,CAACA,CAACA;QAC7CA,CAACA,CAACA,CAACA;QAEHA,CAACA,CAACA,UAAUA,CAACA,GAAGA,CAACA,YAAYA,CAACA;YAC1BA,OAAOA,CAACA,GAAGA,CAACA,8BAA8BA,CAACA,CAACA;QAChDA,CAACA,CAACA,CAACA;IACPA,CAACA;IAEDF,OAAOA,CAACA,IAAYA,EAAEA,IAASA;QAC3BG,QAAQA,CAACA;QACTA,IAAIA,CAACA,UAAUA,CAACA,OAAOA,CAACA,IAAIA,EAAEA,IAAIA,CAACA,CAACA;IACxCA,CAACA;AACLH,CAACA;AA3BD;IAAC,UAAU;;mBA2BV;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/Services/SignalRService.ts b/src/Jackett.Web/Services/SignalRService.ts new file mode 100644 index 000000000..4279be3bb --- /dev/null +++ b/src/Jackett.Web/Services/SignalRService.ts @@ -0,0 +1,35 @@ +import {autoinject} from 'aurelia-framework'; +import {EventAggregator} from 'aurelia-event-aggregator'; +import 'jquery'; +import 'ms-signalr-client'; +import 'jackett-hubs'; +import {IRCMessageCommand} from '../scripts/typings/JackettSignalr'; + +@autoinject +export class SignalRService { + aggregator: EventAggregator; + + constructor(ea: EventAggregator) { + this.aggregator = ea; + } + + start() { + let hub = $.connection.hub.proxies.jacketthubproxy; + hub.client.onEvent = (e, d) => { + this.onEvent(e, d); + }; + + $.connection.hub.start().done(() => { + console.log('Jackett SignalR connected'); + }); + + $.connection.hub.disconnected(() => { + console.log('Jackett SignalR disconnected'); + }); + } + + onEvent(type: string, data: any) { + debugger; + this.aggregator.publish(type, data); + } +} \ No newline at end of file diff --git a/src/Jackett.Web/Services/WebClient.js b/src/Jackett.Web/Services/WebClient.js new file mode 100644 index 000000000..456e4e9cf --- /dev/null +++ b/src/Jackett.Web/Services/WebClient.js @@ -0,0 +1,39 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +import { HttpClient } from 'aurelia-http-client'; +import { autoinject } from 'aurelia-framework'; +export let WebClient = class { + constructor(httpClient) { + this.http = httpClient; + this.http.configure(config => { + config.withHeader('Content-Type', 'application/json'); + config.withHeader('Accept', 'application/json'); + }); + } + get(url) { + return this.http.get('../webapi/' + url + '?_t=' + new Date().getTime()); + } + put(url, obj) { + return this.http.put('../webapi/' + url + '?_t=' + new Date().getTime(), JSON.stringify(obj)); + } + delete(url) { + return this.http.delete('../webapi/' + url + '?_t=' + new Date().getTime()); + } + post(url, obj) { + return this.http.post('../webapi/' + url + '?_t=' + new Date().getTime(), JSON.stringify(obj)); + } +}; +WebClient = __decorate([ + autoinject, + __metadata('design:paramtypes', [HttpClient]) +], WebClient); +//# sourceMappingURL=WebClient.js.map \ No newline at end of file diff --git a/src/Jackett.Web/Services/WebClient.js.map b/src/Jackett.Web/Services/WebClient.js.map new file mode 100644 index 000000000..bb97a9295 --- /dev/null +++ b/src/Jackett.Web/Services/WebClient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"WebClient.js","sourceRoot":"","sources":["WebClient.ts"],"names":["WebClient","WebClient.constructor","WebClient.get","WebClient.put","WebClient.delete","WebClient.post"],"mappings":";;;;;;;;;;;OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB;OACvC,EAAC,UAAU,EAAC,MAAM,mBAAmB;AAE5C;IAIIA,YAAYA,UAAsBA;QAC9BC,IAAIA,CAACA,IAAIA,GAAGA,UAAUA,CAACA;QACvBA,IAAIA,CAACA,IAAIA,CAACA,SAASA,CAACA,MAAMA;YACtBA,MAAMA,CAACA,UAAUA,CAACA,cAAcA,EAAEA,kBAAkBA,CAACA,CAACA;YACtDA,MAAMA,CAACA,UAAUA,CAACA,QAAQA,EAAEA,kBAAkBA,CAACA,CAACA;QACpDA,CAACA,CAACA,CAACA;IACPA,CAACA;IAEDD,GAAGA,CAACA,GAAWA;QACXE,MAAMA,CAACA,IAAIA,CAACA,IAAIA,CAACA,GAAGA,CAACA,YAAYA,GAAGA,GAAGA,GAAGA,MAAMA,GAAGA,IAAIA,IAAIA,EAAEA,CAACA,OAAOA,EAAEA,CAACA,CAACA;IAC7EA,CAACA;IAEDF,GAAGA,CAACA,GAAWA,EAAEA,GAAQA;QACrBG,MAAMA,CAACA,IAAIA,CAACA,IAAIA,CAACA,GAAGA,CAACA,YAAYA,GAAGA,GAAGA,GAAGA,MAAMA,GAAGA,IAAIA,IAAIA,EAAEA,CAACA,OAAOA,EAAEA,EAAEA,IAAIA,CAACA,SAASA,CAACA,GAAGA,CAACA,CAACA,CAACA;IAClGA,CAACA;IAEDH,MAAMA,CAACA,GAAWA;QACdI,MAAMA,CAACA,IAAIA,CAACA,IAAIA,CAACA,MAAMA,CAACA,YAAYA,GAAGA,GAAGA,GAAGA,MAAMA,GAAGA,IAAIA,IAAIA,EAAEA,CAACA,OAAOA,EAAEA,CAACA,CAACA;IAChFA,CAACA;IAEDJ,IAAIA,CAACA,GAAWA,EAAEA,GAAQA;QACtBK,MAAMA,CAACA,IAAIA,CAACA,IAAIA,CAACA,IAAIA,CAACA,YAAYA,GAAGA,GAAGA,GAAGA,MAAMA,GAAGA,IAAIA,IAAIA,EAAEA,CAACA,OAAOA,EAAEA,EAAEA,IAAIA,CAACA,SAASA,CAACA,GAAGA,CAACA,CAACA,CAACA;IACnGA,CAACA;AACLL,CAACA;AA3BD;IAAC,UAAU;;cA2BV;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/Services/WebClient.ts b/src/Jackett.Web/Services/WebClient.ts new file mode 100644 index 000000000..4e3169290 --- /dev/null +++ b/src/Jackett.Web/Services/WebClient.ts @@ -0,0 +1,31 @@ +import {HttpClient} from 'aurelia-http-client' +import {autoinject} from 'aurelia-framework'; + +@autoinject +export class WebClient { + http: HttpClient; + + constructor(httpClient: HttpClient) { + this.http = httpClient; + this.http.configure(config=> { + config.withHeader('Content-Type', 'application/json'); + config.withHeader('Accept', 'application/json'); + }); + } + + get(url: string) { + return this.http.get('../webapi/' + url + '?_t=' + new Date().getTime()); + } + + put(url: string, obj: any) { + return this.http.put('../webapi/' + url + '?_t=' + new Date().getTime(), JSON.stringify(obj)); + } + + delete(url: string) { + return this.http.delete('../webapi/' + url + '?_t=' + new Date().getTime()); + } + + post(url: string, obj: any) { + return this.http.post('../webapi/' + url + '?_t=' + new Date().getTime(), JSON.stringify(obj)); + } +} \ No newline at end of file diff --git a/src/Jackett.Web/Web.Debug.config b/src/Jackett.Web/Web.Debug.config new file mode 100644 index 000000000..24f336cd6 --- /dev/null +++ b/src/Jackett.Web/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/Jackett.Web/Web.Release.config b/src/Jackett.Web/Web.Release.config new file mode 100644 index 000000000..a6579812d --- /dev/null +++ b/src/Jackett.Web/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Jackett.Web/Web.config b/src/Jackett.Web/Web.config new file mode 100644 index 000000000..17832b817 --- /dev/null +++ b/src/Jackett.Web/Web.config @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Jackett.Web/app.html b/src/Jackett.Web/app.html new file mode 100644 index 000000000..33e818f6d --- /dev/null +++ b/src/Jackett.Web/app.html @@ -0,0 +1,39 @@ + \ No newline at end of file diff --git a/src/Jackett.Web/app.js b/src/Jackett.Web/app.js new file mode 100644 index 000000000..8702fe8bc --- /dev/null +++ b/src/Jackett.Web/app.js @@ -0,0 +1,39 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +import { SignalRService } from './Services/SignalRService'; +import { autoinject } from 'aurelia-framework'; +export let App = class { + constructor(sr) { + sr.start(); + } + configureRouter(config, router) { + config.title = 'Jackett'; + // Notice: the overall template is hardcoded to routes based on index. + config.map([ + { route: ['', 'welcome'], name: 'welcome', moduleId: './views/home', title: 'Home' }, + { route: ['indexers'], name: 'indexers', moduleId: './views/indexers', title: 'Indexers' }, + { route: ['irc'], name: 'irc', moduleId: './views/irc', title: 'IRC' }, + { route: ['settings'], name: 'settings', moduleId: './views/settings', title: 'Settings' }, + { route: ['settings'], name: 'settings', moduleId: './views/settings', title: 'Server settings' }, + { route: 'irc-settings', name: 'irc-settings', moduleId: './views/irc-settings', title: 'IRC Settings' }, + { route: 'irc-profile-edit/:name', name: 'irc-profile-edit', moduleId: './views/irc-settings-edit', title: 'Edit Profile' }, + { route: 'irc-profile-create', name: 'irc-profile-create', moduleId: './views/irc-settings-edit', title: 'Create Profile' }, + { route: 'autodlprofile-configure/:type', name: 'autodlprofile-configure', moduleId: './views/autodlprofile-configure', title: 'AutoDL Profile Config' } + ]); + this.router = router; + } +}; +App = __decorate([ + autoinject, + __metadata('design:paramtypes', [SignalRService]) +], App); +//# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/src/Jackett.Web/app.js.map b/src/Jackett.Web/app.js.map new file mode 100644 index 000000000..246b887f6 --- /dev/null +++ b/src/Jackett.Web/app.js.map @@ -0,0 +1 @@ +{"version":3,"file":"app.js","sourceRoot":"","sources":["app.ts"],"names":["App","App.constructor","App.configureRouter"],"mappings":";;;;;;;;;;;OACO,EAAC,cAAc,EAAC,MAAM,2BAA2B;OACjD,EAAC,UAAU,EAAC,MAAM,mBAAmB;AAE5C;IAIIA,YAAYA,EAAkBA;QAC1BC,EAAEA,CAACA,KAAKA,EAAEA,CAACA;IACfA,CAACA;IAEDD,eAAeA,CAACA,MAAMA,EAAEA,MAAcA;QAClCE,MAAMA,CAACA,KAAKA,GAAGA,SAASA,CAACA;QACzBA,sEAAsEA;QACtEA,MAAMA,CAACA,GAAGA,CAACA;YACPA,EAAEA,KAAKA,EAAEA,CAACA,EAAEA,EAAEA,SAASA,CAACA,EAAEA,IAAIA,EAAEA,SAASA,EAAEA,QAAQA,EAAEA,cAAcA,EAAEA,KAAKA,EAAEA,MAAMA,EAAEA;YACpFA,EAAEA,KAAKA,EAAEA,CAACA,UAAUA,CAACA,EAAEA,IAAIA,EAAEA,UAAUA,EAAEA,QAAQA,EAAEA,kBAAkBA,EAAEA,KAAKA,EAAEA,UAAUA,EAAEA;YAC1FA,EAAEA,KAAKA,EAAEA,CAACA,KAAKA,CAACA,EAAEA,IAAIA,EAAEA,KAAKA,EAAEA,QAAQA,EAAEA,aAAaA,EAAEA,KAAKA,EAAEA,KAAKA,EAAEA;YACtEA,EAAEA,KAAKA,EAAEA,CAACA,UAAUA,CAACA,EAAEA,IAAIA,EAAEA,UAAUA,EAAEA,QAAQA,EAAEA,kBAAkBA,EAAEA,KAAKA,EAAEA,UAAUA,EAAEA;YAC1FA,EAAEA,KAAKA,EAAEA,CAACA,UAAUA,CAACA,EAAEA,IAAIA,EAAEA,UAAUA,EAAEA,QAAQA,EAAEA,kBAAkBA,EAAEA,KAAKA,EAAEA,iBAAiBA,EAAEA;YACjGA,EAAEA,KAAKA,EAAEA,cAAcA,EAAEA,IAAIA,EAAEA,cAAcA,EAAEA,QAAQA,EAAEA,sBAAsBA,EAAEA,KAAKA,EAAEA,cAAcA,EAAEA;YACxGA,EAAEA,KAAKA,EAAEA,wBAAwBA,EAAEA,IAAIA,EAAEA,kBAAkBA,EAAEA,QAAQA,EAAEA,2BAA2BA,EAAEA,KAAKA,EAAEA,cAAcA,EAAEA;YAC3HA,EAAEA,KAAKA,EAAEA,oBAAoBA,EAAEA,IAAIA,EAAEA,oBAAoBA,EAAEA,QAAQA,EAAEA,2BAA2BA,EAAEA,KAAKA,EAAEA,gBAAgBA,EAAEA;YAC3HA,EAAEA,KAAKA,EAAEA,+BAA+BA,EAAEA,IAAIA,EAAEA,yBAAyBA,EAAEA,QAAQA,EAAEA,iCAAiCA,EAAEA,KAAKA,EAAEA,uBAAuBA,EAAEA;SAC3JA,CAACA,CAACA;QAEHA,IAAIA,CAACA,MAAMA,GAAGA,MAAMA,CAACA;IACzBA,CAACA;AACLF,CAACA;AAzBD;IAAC,UAAU;;QAyBV;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/app.ts b/src/Jackett.Web/app.ts new file mode 100644 index 000000000..54095d1bd --- /dev/null +++ b/src/Jackett.Web/app.ts @@ -0,0 +1,30 @@ +import {Router} from 'aurelia-router'; +import {SignalRService} from './Services/SignalRService' +import {autoinject} from 'aurelia-framework'; + +@autoinject +export class App { + router: Router; + + constructor(sr: SignalRService) { + sr.start(); + } + + configureRouter(config, router: Router) { + config.title = 'Jackett'; + // Notice: the overall template is hardcoded to routes based on index. + config.map([ + { route: ['', 'welcome'], name: 'welcome', moduleId: './views/home', title: 'Home' }, + { route: ['indexers'], name: 'indexers', moduleId: './views/indexers', title: 'Indexers' }, + { route: ['irc'], name: 'irc', moduleId: './views/irc', title: 'IRC' }, + { route: ['settings'], name: 'settings', moduleId: './views/settings', title: 'Settings' }, + { route: ['settings'], name: 'settings', moduleId: './views/settings', title: 'Server settings' }, + { route: 'irc-settings', name: 'irc-settings', moduleId: './views/irc-settings', title: 'IRC Settings' }, + { route: 'irc-profile-edit/:name', name: 'irc-profile-edit', moduleId: './views/irc-settings-edit', title: 'Edit Profile' }, + { route: 'irc-profile-create', name: 'irc-profile-create', moduleId: './views/irc-settings-edit', title: 'Create Profile' }, + { route: 'autodlprofile-configure/:type', name: 'autodlprofile-configure', moduleId: './views/autodlprofile-configure', title: 'AutoDL Profile Config' } + ]); + + this.router = router; + } +} \ No newline at end of file diff --git a/src/Jackett.Web/aureliafile.js b/src/Jackett.Web/aureliafile.js new file mode 100644 index 000000000..89c961814 --- /dev/null +++ b/src/Jackett.Web/aureliafile.js @@ -0,0 +1,24 @@ +var aurelia = require('aurelia-cli'); + +aurelia.command('bundle', { + js: { + "dist/app-bundle": { + modules: [ + 'dist/*', + 'aurelia-bootstrapper', + 'aurelia-http-client', + 'aurelia-router', + 'aurelia-animator-css', + 'github:aurelia/templating-binding@0.14.0', + 'github:aurelia/templating-resources@0.14.0', + 'github:aurelia/templating-router@0.15.0', + 'github:aurelia/loader-default@0.9.5', + 'github:aurelia/history-browser@0.7.0' + ], + options: { + inject: true, + minify: true + } + } + } +}); \ No newline at end of file diff --git a/src/Jackett.Web/config.js b/src/Jackett.Web/config.js new file mode 100644 index 000000000..ff19a0c95 --- /dev/null +++ b/src/Jackett.Web/config.js @@ -0,0 +1,188 @@ +System.config({ + baseURL: "/dev", + defaultJSExtensions: true, + transpiler: "babel", + babelOptions: { + "optional": [ + "runtime", + "optimisation.modules.system" + ] + }, + paths: { + "jackett-hubs": "/signalr/hubs", + "github:*": "jspm_packages/github/*", + "npm:*": "jspm_packages/npm/*" + }, + map: { + "aurelia-animator-css": "github:aurelia/animator-css@0.15.0", + "aurelia-bootstrapper": "github:aurelia/bootstrapper@0.16.0", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.9.2", + "aurelia-fetch-client": "github:aurelia/fetch-client@0.2.0", + "aurelia-framework": "github:aurelia/framework@0.15.0", + "aurelia-http-client": "github:aurelia/http-client@0.11.0", + "aurelia-router": "github:aurelia/router@0.11.0", + "aurelia-validation": "github:aurelia/validation@0.2.8", + "babel": "npm:babel-core@5.8.23", + "babel-runtime": "npm:babel-runtime@5.8.20", + "core-js": "npm:core-js@1.1.4", + "font-awesome": "npm:font-awesome@4.4.0", + "jquery": "github:components/jquery@2.1.4", + "moment": "npm:moment@2.10.6", + "ms-signalr-client": "npm:ms-signalr-client@2.2.2", + "polymer/mutationobservers": "github:polymer/mutationobservers@0.4.2", + "semantic-ui": "github:Semantic-Org/Semantic-UI@2.1.3", + "whatwg-fetch": "npm:whatwg-fetch@0.9.0", + "github:Semantic-Org/Semantic-UI@2.1.3": { + "css": "github:systemjs/plugin-css@0.1.16", + "jquery": "github:components/jquery@2.1.4" + }, + "github:aurelia/animator-css@0.15.0": { + "aurelia-metadata": "github:aurelia/metadata@0.7.3", + "aurelia-templating": "github:aurelia/templating@0.14.4" + }, + "github:aurelia/binding@0.8.6": { + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.9.2", + "aurelia-metadata": "github:aurelia/metadata@0.7.3", + "aurelia-task-queue": "github:aurelia/task-queue@0.6.2", + "core-js": "npm:core-js@0.9.18" + }, + "github:aurelia/bootstrapper@0.16.0": { + "aurelia-event-aggregator": "github:aurelia/event-aggregator@0.7.0", + "aurelia-framework": "github:aurelia/framework@0.15.0", + "aurelia-history": "github:aurelia/history@0.6.1", + "aurelia-history-browser": "github:aurelia/history-browser@0.7.0", + "aurelia-loader-default": "github:aurelia/loader-default@0.9.5", + "aurelia-logging-console": "github:aurelia/logging-console@0.6.2", + "aurelia-router": "github:aurelia/router@0.11.0", + "aurelia-templating": "github:aurelia/templating@0.14.4", + "aurelia-templating-binding": "github:aurelia/templating-binding@0.14.0", + "aurelia-templating-resources": "github:aurelia/templating-resources@0.14.0", + "aurelia-templating-router": "github:aurelia/templating-router@0.15.0", + "core-js": "npm:core-js@0.9.18" + }, + "github:aurelia/dependency-injection@0.9.2": { + "aurelia-logging": "github:aurelia/logging@0.6.4", + "aurelia-metadata": "github:aurelia/metadata@0.7.3", + "core-js": "npm:core-js@0.9.18" + }, + "github:aurelia/event-aggregator@0.7.0": { + "aurelia-logging": "github:aurelia/logging@0.6.4" + }, + "github:aurelia/fetch-client@0.2.0": { + "core-js": "npm:core-js@0.9.18" + }, + "github:aurelia/framework@0.15.0": { + "aurelia-binding": "github:aurelia/binding@0.8.6", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.9.2", + "aurelia-loader": "github:aurelia/loader@0.8.7", + "aurelia-logging": "github:aurelia/logging@0.6.4", + "aurelia-metadata": "github:aurelia/metadata@0.7.3", + "aurelia-path": "github:aurelia/path@0.8.1", + "aurelia-task-queue": "github:aurelia/task-queue@0.6.2", + "aurelia-templating": "github:aurelia/templating@0.14.4", + "core-js": "npm:core-js@0.9.18" + }, + "github:aurelia/history-browser@0.7.0": { + "aurelia-history": "github:aurelia/history@0.6.1", + "core-js": "npm:core-js@0.9.18" + }, + "github:aurelia/http-client@0.11.0": { + "aurelia-path": "github:aurelia/path@0.9.0", + "core-js": "npm:core-js@0.9.18" + }, + "github:aurelia/loader-default@0.9.5": { + "aurelia-loader": "github:aurelia/loader@0.8.7", + "aurelia-metadata": "github:aurelia/metadata@0.7.3" + }, + "github:aurelia/loader@0.8.7": { + "aurelia-html-template-element": "github:aurelia/html-template-element@0.2.0", + "aurelia-metadata": "github:aurelia/metadata@0.7.3", + "aurelia-path": "github:aurelia/path@0.8.1", + "core-js": "npm:core-js@0.9.18", + "webcomponentsjs": "github:webcomponents/webcomponentsjs@0.6.3" + }, + "github:aurelia/logging-console@0.6.2": { + "aurelia-logging": "github:aurelia/logging@0.6.4" + }, + "github:aurelia/metadata@0.7.3": { + "core-js": "npm:core-js@0.9.18" + }, + "github:aurelia/route-recognizer@0.6.2": { + "core-js": "npm:core-js@0.9.18" + }, + "github:aurelia/router@0.11.0": { + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.9.2", + "aurelia-event-aggregator": "github:aurelia/event-aggregator@0.7.0", + "aurelia-history": "github:aurelia/history@0.6.1", + "aurelia-logging": "github:aurelia/logging@0.6.4", + "aurelia-path": "github:aurelia/path@0.8.1", + "aurelia-route-recognizer": "github:aurelia/route-recognizer@0.6.2", + "core-js": "npm:core-js@0.9.18" + }, + "github:aurelia/templating-binding@0.14.0": { + "aurelia-binding": "github:aurelia/binding@0.8.6", + "aurelia-logging": "github:aurelia/logging@0.6.4", + "aurelia-templating": "github:aurelia/templating@0.14.4" + }, + "github:aurelia/templating-resources@0.14.0": { + "aurelia-binding": "github:aurelia/binding@0.8.6", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.9.2", + "aurelia-logging": "github:aurelia/logging@0.6.4", + "aurelia-task-queue": "github:aurelia/task-queue@0.6.2", + "aurelia-templating": "github:aurelia/templating@0.14.4", + "core-js": "npm:core-js@0.9.18" + }, + "github:aurelia/templating-router@0.15.0": { + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.9.2", + "aurelia-metadata": "github:aurelia/metadata@0.7.3", + "aurelia-path": "github:aurelia/path@0.8.1", + "aurelia-router": "github:aurelia/router@0.11.0", + "aurelia-templating": "github:aurelia/templating@0.14.4" + }, + "github:aurelia/templating@0.14.4": { + "aurelia-binding": "github:aurelia/binding@0.8.6", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.9.2", + "aurelia-html-template-element": "github:aurelia/html-template-element@0.2.0", + "aurelia-loader": "github:aurelia/loader@0.8.7", + "aurelia-logging": "github:aurelia/logging@0.6.4", + "aurelia-metadata": "github:aurelia/metadata@0.7.3", + "aurelia-path": "github:aurelia/path@0.8.1", + "aurelia-task-queue": "github:aurelia/task-queue@0.6.2", + "core-js": "npm:core-js@0.9.18" + }, + "github:aurelia/validation@0.2.8": { + "aurelia-binding": "github:aurelia/binding@0.8.6", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.9.2", + "aurelia-logging": "github:aurelia/logging@0.6.4", + "aurelia-templating": "github:aurelia/templating@0.14.4" + }, + "github:jspm/nodelibs-process@0.1.1": { + "process": "npm:process@0.10.1" + }, + "npm:babel-runtime@5.8.20": { + "process": "github:jspm/nodelibs-process@0.1.1" + }, + "npm:core-js@0.9.18": { + "fs": "github:jspm/nodelibs-fs@0.1.2", + "process": "github:jspm/nodelibs-process@0.1.1", + "systemjs-json": "github:systemjs/plugin-json@0.1.0" + }, + "npm:core-js@1.1.4": { + "fs": "github:jspm/nodelibs-fs@0.1.2", + "process": "github:jspm/nodelibs-process@0.1.1", + "systemjs-json": "github:systemjs/plugin-json@0.1.0" + }, + "npm:font-awesome@4.4.0": { + "css": "github:systemjs/plugin-css@0.1.16" + }, + "npm:jquery@2.1.4": { + "process": "github:jspm/nodelibs-process@0.1.1" + }, + "npm:moment@2.10.6": { + "process": "github:jspm/nodelibs-process@0.1.1" + }, + "npm:ms-signalr-client@2.2.2": { + "jquery": "npm:jquery@2.1.4" + } + } +}); diff --git a/src/Jackett.Web/content/jacket_medium.png b/src/Jackett.Web/content/jacket_medium.png new file mode 100644 index 000000000..7735dcbf1 Binary files /dev/null and b/src/Jackett.Web/content/jacket_medium.png differ diff --git a/src/Jackett.Web/gulpfile.js b/src/Jackett.Web/gulpfile.js new file mode 100644 index 000000000..4b28ec106 --- /dev/null +++ b/src/Jackett.Web/gulpfile.js @@ -0,0 +1,3 @@ +// all gulp tasks are located in the ./build/tasks directory +// gulp configuration is in files in ./build directory +require('require-dir')('build/tasks'); diff --git a/src/Jackett.Web/main.js b/src/Jackett.Web/main.js new file mode 100644 index 000000000..c363549b7 --- /dev/null +++ b/src/Jackett.Web/main.js @@ -0,0 +1,14 @@ +import { LogManager } from 'aurelia-framework'; +import { ConsoleAppender } from 'aurelia-logging-console'; +import 'aurelia-validation'; +import { ValidateCustomAttributeViewStrategy } from 'aurelia-validation'; +LogManager.addAppender(new ConsoleAppender()); +LogManager.setLevel(LogManager.logLevel.debug); +export function configure(aurelia) { + aurelia.use.standardConfiguration() + .plugin('./resources/MomentValueConverter', undefined) + .developmentLogging() + .plugin('aurelia-validation', (config) => { config.useViewStrategy(ValidateCustomAttributeViewStrategy.TWBootstrapAppendToMessage); }); + aurelia.start().then(a => a.setRoot('app', document.body)); +} +//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/src/Jackett.Web/main.js.map b/src/Jackett.Web/main.js.map new file mode 100644 index 000000000..6525b7e3a --- /dev/null +++ b/src/Jackett.Web/main.js.map @@ -0,0 +1 @@ +{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":["configure"],"mappings":"OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB;OACrC,EAAC,eAAe,EAAC,MAAM,yBAAyB;OAEhD,oBAAoB;OACpB,EAAC,mCAAmC,EAAC,MAAM,oBAAoB;AAEtE,UAAU,CAAC,WAAW,CAAC,IAAI,eAAe,EAAE,CAAC,CAAC;AAC9C,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAE/C,0BAA0B,OAAgB;IACtCA,OAAOA,CAACA,GAAGA,CAACA,qBAAqBA,EAAEA;SAC9BA,MAAMA,CAACA,kCAAkCA,EAAEA,SAASA,CAACA;SACrDA,kBAAkBA,EAAEA;SACpBA,MAAMA,CAACA,oBAAoBA,EAAEA,CAACA,MAAMA,OAAOA,MAAMA,CAACA,eAAeA,CAACA,mCAAmCA,CAACA,0BAA0BA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;IAE3IA,OAAOA,CAACA,KAAKA,EAAEA,CAACA,IAAIA,CAACA,CAACA,IAAIA,CAACA,CAACA,OAAOA,CAACA,KAAKA,EAAEA,QAAQA,CAACA,IAAIA,CAACA,CAACA,CAACA;AAC/DA,CAACA"} \ No newline at end of file diff --git a/src/Jackett.Web/main.ts b/src/Jackett.Web/main.ts new file mode 100644 index 000000000..d482b5fb2 --- /dev/null +++ b/src/Jackett.Web/main.ts @@ -0,0 +1,17 @@ +import {LogManager} from 'aurelia-framework'; +import {ConsoleAppender} from 'aurelia-logging-console'; +import {Aurelia} from 'aurelia-framework'; +import 'aurelia-validation'; +import {ValidateCustomAttributeViewStrategy} from 'aurelia-validation'; + +LogManager.addAppender(new ConsoleAppender()); +LogManager.setLevel(LogManager.logLevel.debug); + +export function configure(aurelia: Aurelia) { + aurelia.use.standardConfiguration() + .plugin('./resources/MomentValueConverter', undefined) + .developmentLogging() + .plugin('aurelia-validation', (config) => { config.useViewStrategy(ValidateCustomAttributeViewStrategy.TWBootstrapAppendToMessage); }); + + aurelia.start().then(a => a.setRoot('app', document.body)); +} \ No newline at end of file diff --git a/src/Jackett.Web/package.json b/src/Jackett.Web/package.json new file mode 100644 index 000000000..08ca9a507 --- /dev/null +++ b/src/Jackett.Web/package.json @@ -0,0 +1,34 @@ +{ + "jspm": { + "directories": {}, + "dependencies": { + "aurelia-animator-css": "github:aurelia/animator-css@^0.15.0", + "aurelia-bootstrapper": "github:aurelia/bootstrapper@^0.16.0", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@^0.9.2", + "aurelia-fetch-client": "github:aurelia/fetch-client@^0.2.0", + "aurelia-framework": "github:aurelia/framework@^0.15.0", + "aurelia-http-client": "github:aurelia/http-client@^0.11.0", + "aurelia-router": "github:aurelia/router@^0.11.0", + "aurelia-validation": "github:aurelia/validation@^0.2.8", + "font-awesome": "npm:font-awesome@^4.4.0", + "jquery": "github:components/jquery@^2.1.4", + "moment": "npm:moment@^2.10.6", + "ms-signalr-client": "npm:ms-signalr-client@^2.2.2", + "polymer/mutationobservers": "github:polymer/mutationobservers@^0.4.2", + "semantic-ui": "github:Semantic-Org/Semantic-UI@^2.0.8", + "whatwg-fetch": "npm:whatwg-fetch@^0.9.0" + }, + "devDependencies": { + "babel": "npm:babel-core@^5.8.22", + "babel-runtime": "npm:babel-runtime@^5.8.20", + "core-js": "npm:core-js@^1.1.0" + } + }, + "devDependencies": { + "aurelia-cli": "^0.3.1", + "jspm": "^0.16.2" + }, + "dependencies": { + "whatwg-fetch": "^0.9.0" + } +} diff --git a/src/Jackett.Web/packages.config b/src/Jackett.Web/packages.config new file mode 100644 index 000000000..be4466bf2 --- /dev/null +++ b/src/Jackett.Web/packages.config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Jackett.Web/styles/styles.css b/src/Jackett.Web/styles/styles.css new file mode 100644 index 000000000..5492b66c8 --- /dev/null +++ b/src/Jackett.Web/styles/styles.css @@ -0,0 +1,140 @@ +body { + background-color: #FFFFFF; +} + +.ui.menu .item img.logo { + margin-right: 1.5em; +} + +.main.container { + margin-top: 7em; +} + +.wireframe { + margin-top: 2em; +} + +.ui.footer.segment { + margin: 5em 0em 0em; + padding: 5em 0em; +} + +.main { + min-height: 20em; +} + +.splash { + text-align: center; + margin-top: 10em; +} + + .splash .message { + margin-bottom: 2em; + } + + +.ui.inverted.menu { + background: #52708D !important; +} + +.logo { + margin-right: 1em !important; +} + +/* IRC */ + +.jackett-irc { + position: absolute; + top: 52px; + left: 0; + right: 0; + bottom: 0; + background-color: #000; + z-index: 2; + color: #fff; + display: flex; + flex-direction: row; + flex-wrap: nowrap; +} + +.jackett-irc-networks { + flex-grow: 1; + min-width: 200px; + border-right: 1px solid #52708D; + padding: 10px; +} + +.jackett-irc-logs { + flex-grow: 20; + min-width: 200px; + overflow-y: scroll; + position: relative; +} + +.jackett-irc-log-time, .jackett-irc-log-user, .jackett-irc-log-msg { + display: inline-block; + vertical-align:top; +} + +.jackett-irc-log-user { + padding-right: 10px; + border-right: 1px grey solid; + margin-left: 10px; +} + +.jackett-irc-log-msg { + margin-left: 10px; + word-break: break-all; +} + +.jackett-irc-log-msg pre { + margin: 0; + padding: 0; + word-wrap: break-word; + white-space: pre-line; +} + +.jackett-irc-users { + flex-grow: 1; + min-width: 200px; + border-left: 1px solid #52708D; + padding: 10px; +} + +.jackett-irc-channel { + margin-left: 10px; +} + +.jackett-irc-network i { + padding-right: 5px; + +} + +.jackett-body-fill { + overflow: hidden; +} + +.ui.form .field > label, .aurelia-validation-message{ + display:inline-block !important; +} + +.aurelia-validation-message{ + margin-left: 10px; + color:red; +} + +.jackett-irc-selected { + background-color: grey; +} + +.jackett-irc-command{ + bottom: 0; + width: 100%; + top: auto; + position: absolute; + background-color:#2F2D2D; +} + +.jackett-ircprofile-server i{ + padding-top: 10px; +} \ No newline at end of file diff --git a/src/Jackett.Web/tsconfig.json b/src/Jackett.Web/tsconfig.json new file mode 100644 index 000000000..ad5e369b5 --- /dev/null +++ b/src/Jackett.Web/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noImplicitAny": false, + "noEmitOnError": true, + "removeComments": false, + "noExternalResolve": true, + "declarationFiles": false, + "target": "es5", + "module": "systemjs" + } +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia-amd/aurelia-amd.d.js b/src/Jackett.Web/typings/aurelia-amd/aurelia-amd.d.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/Jackett.Web/typings/aurelia-amd/aurelia-amd.d.ts b/src/Jackett.Web/typings/aurelia-amd/aurelia-amd.d.ts new file mode 100644 index 000000000..871318095 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia-amd/aurelia-amd.d.ts @@ -0,0 +1,11 @@ +declare module "loader-amd" { + class System { + static normalize(moduleId: string, normalizedParentModuleId?: string): Promise; + static map: Object; + static importModule(moduleId: string): Promise; + } + + class LoaderAmd { + loadModule(moduleId: string): Promise; + } +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-animator-css.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-animator-css.d.ts new file mode 100644 index 000000000..556da08da --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-animator-css.d.ts @@ -0,0 +1,24 @@ +declare module 'aurelia-animator-css/animator' { + export class CssAnimator { + animationStack: any; + constructor(); + addMultipleEventListener(el: any, s: any, fn: any, b: any): void; + addAnimationToStack(animId: any): void; + removeAnimationFromStack(animId: any): void; + getElementAnimationDelay(element: any): number; + move(): Promise; + enter(element: any): Promise<{}>; + leave(element: any): Promise<{}>; + removeClass(element: any, className: any): Promise<{}>; + addClass(element: any, className: any): Promise<{}>; + } + +} +declare module 'aurelia-animator-css/index' { + export { CssAnimator } from 'aurelia-animator-css/animator'; + export function configure(aurelia: any): void; + +} +declare module 'aurelia-animator-css' { + export * from 'aurelia-animator-css/index'; +} diff --git a/src/Jackett.Web/typings/aurelia/aurelia-app-contacts.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-app-contacts.d.ts new file mode 100644 index 000000000..8b83b2591 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-app-contacts.d.ts @@ -0,0 +1,77 @@ +declare module 'aurelia-app-contacts/web-api' { + export class WebAPI { + isRequesting: any; + getContactList(): Promise<{}>; + getContactDetails(id: any): Promise<{}>; + saveContact(contact: any): Promise<{}>; + } + +} +declare module 'aurelia-app-contacts/app' { + import { Router } from 'aurelia-router'; + import { WebAPI } from 'aurelia-app-contacts/web-api'; + export class App { + static inject: typeof WebAPI[]; + router: Router; + api: any; + constructor(api: any); + configureRouter(config: any, router: any): void; + } + +} +declare module 'aurelia-app-contacts/messages' { + export class ContactUpdated { + contact: any; + constructor(contact: any); + } + export class ContactViewed { + contact: any; + constructor(contact: any); + } + +} +declare module 'aurelia-app-contacts/utility' { + export function areEqual(obj1: any, obj2: any): boolean; + +} +declare module 'aurelia-app-contacts/contact-detail' { + export class ContactDetail { + static inject: any[]; + api: any; + ea: any; + contact: any; + originalContact: any; + constructor(api: any, ea: any); + activate(params: any, config: any): any; + canSave: boolean; + save(): void; + canDeactivate(): boolean; + } + +} +declare module 'aurelia-app-contacts/contact-list' { + export class ContactList { + static inject: any[]; + api: any; + contacts: any; + selectedId: any; + constructor(api: any, ea: any); + created(): void; + select(contact: any): boolean; + } + +} +declare module 'aurelia-app-contacts/loading-indicator' { + export class LoadingIndicator { + loading: boolean; + loadingChanged(newValue: any): void; + } + +} +declare module 'aurelia-app-contacts/no-selection' { + export class NoSelection { + message: any; + constructor(); + } + +} diff --git a/src/Jackett.Web/typings/aurelia/aurelia-binding.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-binding.d.ts new file mode 100644 index 000000000..269ad50b2 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-binding.d.ts @@ -0,0 +1,443 @@ +declare module 'aurelia-binding' { + import core from 'core-js'; + import { TaskQueue } from 'aurelia-task-queue'; + import { All, Container } from 'aurelia-dependency-injection'; + import { Decorators, Metadata } from 'aurelia-metadata'; + export class AccessKeyedObserver { + constructor(objectInfo: any, keyInfo: any, observerLocator: any, evaluate: any); + updatePropertySubscription(object: any, key: any): any; + objectOrKeyChanged(object: any, key: any): any; + subscribe(callback: any): any; + notify(): any; + dispose(): any; + } + export function calcSplices(current: any, currentStart: any, currentEnd: any, old: any, oldStart: any, oldEnd: any): any; + export function projectArraySplices(array: any, changeRecords: any): any; + export var hasObjectObserve: any; + export var hasArrayObserve: any; + export function getChangeRecords(map: any): any; + export class ModifyCollectionObserver { + constructor(taskQueue: any, collection: any); + subscribe(callback: any): any; + addChangeRecord(changeRecord: any): any; + reset(oldCollection: any): any; + getLengthObserver(): any; + call(): any; + } + export class CollectionLengthObserver { + constructor(collection: any); + getValue(): any; + setValue(newValue: any): any; + subscribe(callback: any): any; + call(newValue: any): any; + } + export function getArrayObserver(taskQueue: any, array: any): any; + class ModifyArrayObserver extends ModifyCollectionObserver { + constructor(taskQueue: any, array: any); + static create(taskQueue: any, array: any): any; + } + class ArrayObserveObserver { + constructor(array: any); + subscribe(callback: any): any; + getLengthObserver(): any; + handleChanges(changeRecords: any): any; + } + export class PathObserver { + constructor(leftObserver: any, getRightObserver: any, value: any); + updateRight(observer: any): any; + subscribe(callback: any): any; + notify(newValue: any): any; + dispose(): any; + } + export class CompositeObserver { + constructor(observers: any, evaluate: any); + subscribe(callback: any): any; + notify(newValue: any): any; + dispose(): any; + } + export class Expression { + constructor(); + evaluate(scope: any, valueConverters: any, args?: any): any; + assign(scope: any, value: any, valueConverters: any): any; + toString(): any; + } + export class Chain extends Expression { + constructor(expressions: any); + evaluate(scope: any, valueConverters: any): any; + accept(visitor: any): any; + } + export class ValueConverter extends Expression { + constructor(expression: any, name: any, args: any, allArgs: any); + evaluate(scope: any, valueConverters: any): any; + assign(scope: any, value: any, valueConverters: any): any; + accept(visitor: any): any; + connect(binding: any, scope: any): any; + } + export class Assign extends Expression { + constructor(target: any, value: any); + evaluate(scope: any, valueConverters: any): any; + accept(vistor: any): any; + connect(binding: any, scope: any): any; + } + export class Conditional extends Expression { + constructor(condition: any, yes: any, no: any); + evaluate(scope: any, valueConverters: any): any; + accept(visitor: any): any; + connect(binding: any, scope: any): any; + } + export class AccessScope extends Expression { + constructor(name: any); + evaluate(scope: any, valueConverters: any): any; + assign(scope: any, value: any): any; + accept(visitor: any): any; + connect(binding: any, scope: any): any; + } + export class AccessMember extends Expression { + constructor(object: any, name: any); + evaluate(scope: any, valueConverters: any): any; + assign(scope: any, value: any): any; + accept(visitor: any): any; + connect(binding: any, scope: any): any; + } + export class AccessKeyed extends Expression { + constructor(object: any, key: any); + evaluate(scope: any, valueConverters: any): any; + assign(scope: any, value: any): any; + accept(visitor: any): any; + connect(binding: any, scope: any): any; + } + export class CallScope extends Expression { + constructor(name: any, args: any); + evaluate(scope: any, valueConverters: any, args: any): any; + accept(visitor: any): any; + connect(binding: any, scope: any): any; + } + export class CallMember extends Expression { + constructor(object: any, name: any, args: any); + evaluate(scope: any, valueConverters: any, args: any): any; + accept(visitor: any): any; + connect(binding: any, scope: any): any; + } + export class CallFunction extends Expression { + constructor(func: any, args: any); + evaluate(scope: any, valueConverters: any, args: any): any; + accept(visitor: any): any; + connect(binding: any, scope: any): any; + } + export class Binary extends Expression { + constructor(operation: any, left: any, right: any); + evaluate(scope: any, valueConverters: any): any; + accept(visitor: any): any; + connect(binding: any, scope: any): any; + } + export class PrefixNot extends Expression { + constructor(operation: any, expression: any); + evaluate(scope: any, valueConverters: any): any; + accept(visitor: any): any; + connect(binding: any, scope: any): any; + } + export class LiteralPrimitive extends Expression { + constructor(value: any); + evaluate(scope: any, valueConverters: any): any; + accept(visitor: any): any; + connect(binding: any, scope: any): any; + } + export class LiteralString extends Expression { + constructor(value: any); + evaluate(scope: any, valueConverters: any): any; + accept(visitor: any): any; + connect(binding: any, scope: any): any; + } + export class LiteralArray extends Expression { + constructor(elements: any); + evaluate(scope: any, valueConverters: any): any; + accept(visitor: any): any; + connect(binding: any, scope: any): any; + } + export class LiteralObject extends Expression { + constructor(keys: any, values: any); + evaluate(scope: any, valueConverters: any): any; + accept(visitor: any): any; + connect(binding: any, scope: any): any; + } + export class Unparser { + constructor(buffer: any); + static unparse(expression: any): any; + write(text: any): any; + writeArgs(args: any): any; + visitChain(chain: any): any; + visitValueConverter(converter: any): any; + visitAssign(assign: any): any; + visitConditional(conditional: any): any; + visitAccessScope(access: any): any; + visitAccessMember(access: any): any; + visitAccessKeyed(access: any): any; + visitCallScope(call: any): any; + visitCallFunction(call: any): any; + visitCallMember(call: any): any; + visitPrefix(prefix: any): any; + visitBinary(binary: any): any; + visitLiteralPrimitive(literal: any): any; + visitLiteralArray(literal: any): any; + visitLiteralObject(literal: any): any; + visitLiteralString(literal: any): any; + } + export var bindingMode: any; + export class Token { + constructor(index: any, text: any); + withOp(op: any): any; + withGetterSetter(key: any): any; + withValue(value: any): any; + toString(): any; + } + export class Lexer { + lex(text: any): any; + } + export class Scanner { + constructor(input: any); + scanToken(): any; + scanCharacter(start: any, text: any): any; + scanOperator(start: any, text: any): any; + scanComplexOperator(start: any, code: any, one: any, two: any): any; + scanIdentifier(): any; + scanNumber(start: any): any; + scanString(): any; + advance(): any; + error(message: any, offset?: any): any; + } + export class Parser { + constructor(); + parse(input: any): any; + } + export class ParserImplementation { + constructor(lexer: any, input: any); + peek(): any; + parseChain(): any; + parseValueConverter(): any; + parseExpression(): any; + parseConditional(): any; + parseLogicalOr(): any; + parseLogicalAnd(): any; + parseEquality(): any; + parseRelational(): any; + parseAdditive(): any; + parseMultiplicative(): any; + parsePrefix(): any; + parseAccessOrCallMember(): any; + parsePrimary(): any; + parseAccessOrCallScope(): any; + parseObject(): any; + parseExpressionList(terminator: any): any; + optional(text: any): any; + expect(text: any): any; + advance(): any; + error(message: any): any; + } + export function getMapObserver(taskQueue: any, map: any): any; + class ModifyMapObserver extends ModifyCollectionObserver { + constructor(taskQueue: any, map: any); + static create(taskQueue: any, map: any): any; + } + class DelegateHandlerEntry { + constructor(eventName: any); + increment(): any; + decrement(): any; + } + class DefaultEventStrategy { + subscribe(target: any, targetEvent: any, callback: any, delegate: any): any; + } + export class EventManager { + constructor(); + registerElementConfig(config: any): any; + registerElementPropertyConfig(tagName: any, propertyName: any, events: any): any; + registerElementHandler(tagName: any, handler: any): any; + registerEventStrategy(eventName: any, strategy: any): any; + getElementHandler(target: any, propertyName: any): any; + addEventListener(target: any, targetEvent: any, callback: any, delegate: any): any; + } + export class DirtyChecker { + constructor(); + addProperty(property: any): any; + removeProperty(property: any): any; + scheduleDirtyCheck(): any; + check(): any; + } + export class DirtyCheckProperty { + constructor(dirtyChecker: any, obj: any, propertyName: any); + getValue(): any; + setValue(newValue: any): any; + call(): any; + isDirty(): any; + beginTracking(): any; + endTracking(): any; + subscribe(callback: any): any; + } + export class SetterObserver { + constructor(taskQueue: any, obj: any, propertyName: any); + getValue(): any; + setValue(newValue: any): any; + getterValue(): any; + setterValue(newValue: any): any; + call(): any; + subscribe(callback: any): any; + convertProperty(): any; + } + export class OoPropertyObserver { + constructor(obj: any, propertyName: any, subscribe: any); + getValue(): any; + setValue(newValue: any): any; + } + export class OoObjectObserver { + constructor(obj: any, observerLocator: any); + subscribe(propertyName: any, callback: any): any; + unsubscribe(propertyName: any, callback: any): any; + getObserver(propertyName: any, descriptor: any): any; + handleChanges(changes: any): any; + } + export class UndefinedPropertyObserver { + constructor(owner: any, obj: any, propertyName: any); + getValue(): any; + setValue(newValue: any): any; + trigger(newValue: any, oldValue: any): any; + getObserver(): any; + subscribe(callback: any): any; + } + export class XLinkAttributeObserver { + + // xlink namespaced attributes require getAttributeNS/setAttributeNS + // (even though the NS version doesn't work for other namespaces + // in html5 documents) + constructor(element: any, propertyName: any, attributeName: any); + getValue(): any; + setValue(newValue: any): any; + subscribe(callback: any): any; + } + export class DataAttributeObserver { + constructor(element: any, propertyName: any); + getValue(): any; + setValue(newValue: any): any; + subscribe(callback: any): any; + } + export class StyleObserver { + constructor(element: any, propertyName: any); + getValue(): any; + setValue(newValue: any): any; + subscribe(callback: any): any; + flattenCss(object: any): any; + } + export class ValueAttributeObserver { + constructor(element: any, propertyName: any, handler: any); + getValue(): any; + setValue(newValue: any): any; + call(): any; + subscribe(callback: any): any; + unsubscribe(callback: any): any; + } + export class SelectValueObserver { + constructor(element: any, handler: any, observerLocator: any); + getValue(): any; + setValue(newValue: any): any; + synchronizeOptions(): any; + synchronizeValue(): any; + call(): any; + subscribe(callback: any): any; + unsubscribe(callback: any): any; + bind(): any; + unbind(): any; + } + export class CheckedObserver { + constructor(element: any, handler: any, observerLocator: any); + getValue(): any; + setValue(newValue: any): any; + synchronizeElement(): any; + synchronizeValue(): any; + call(): any; + subscribe(callback: any): any; + unsubscribe(callback: any): any; + unbind(): any; + } + export class ClassObserver { + constructor(element: any); + getValue(): any; + setValue(newValue: any): any; + subscribe(callback: any): any; + } + export class ComputedPropertyObserver { + constructor(obj: any, propertyName: any, descriptor: any, observerLocator: any); + getValue(): any; + setValue(newValue: any): any; + trigger(newValue: any, oldValue: any): any; + evaluate(): any; + subscribe(callback: any): any; + } + export function hasDeclaredDependencies(descriptor: any): any; + export function declarePropertyDependencies(ctor: any, propertyName: any, dependencies: any): any; + export var elements: any; + export var presentationElements: any; + export var presentationAttributes: any; + export function isStandardSvgAttribute(nodeName: any, attributeName: any): any; + export class ObserverLocator { + static inject(): any; + constructor(taskQueue: any, eventManager: any, dirtyChecker: any, observationAdapters: any); + getObserver(obj: any, propertyName: any): any; + getOrCreateObserversLookup(obj: any): any; + createObserversLookup(obj: any): any; + getObservationAdapter(obj: any, propertyName: any, descriptor: any): any; + createPropertyObserver(obj: any, propertyName: any): any; + getArrayObserver(array: any): any; + getMapObserver(map: any): any; + } + export class ObjectObservationAdapter { + handlesProperty(object: any, propertyName: any, descriptor: any): any; + getObserver(object: any, propertyName: any, descriptor: any): any; + } + export class BindingExpression { + constructor(observerLocator: any, targetProperty: any, sourceExpression: any, mode: any, valueConverterLookupFunction: any, attribute: any); + createBinding(target: any): any; + static create(targetProperty: any, sourceExpression: any, mode?: any): any; + } + class Binding { + constructor(observerLocator: any, sourceExpression: any, target: any, targetProperty: any, mode: any, valueConverterLookupFunction: any); + getObserver(obj: any, propertyName: any): any; + bind(source: any): any; + unbind(): any; + } + export class CallExpression { + constructor(observerLocator: any, targetProperty: any, sourceExpression: any, valueConverterLookupFunction: any); + createBinding(target: any): any; + } + class Call { + constructor(observerLocator: any, sourceExpression: any, target: any, targetProperty: any, valueConverterLookupFunction: any); + bind(source: any): any; + unbind(): any; + } + export class ValueConverterResource { + constructor(name: any); + static convention(name: any): any; + analyze(container: any, target: any): any; + register(registry: any, name: any): any; + load(container: any, target: any): any; + } + + // ES7 Decorators + export function valueConverter(nameOrTarget: any): any; + export function computedFrom(...rest: any[]): any; + export class ListenerExpression { + constructor(eventManager: any, targetEvent: any, sourceExpression: any, delegate: any, preventDefault: any); + createBinding(target: any): any; + } + class Listener { + constructor(eventManager: any, targetEvent: any, delegate: any, sourceExpression: any, target: any, preventDefault: any); + bind(source: any): any; + unbind(): any; + } + export class NameExpression { + constructor(name: any, mode: any); + createBinding(target: any): any; + } + class NameBinder { + constructor(property: any, target: any, mode: any); + bind(source: any): any; + unbind(): any; + } +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-bootstrapper.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-bootstrapper.d.ts new file mode 100644 index 000000000..b753702e8 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-bootstrapper.d.ts @@ -0,0 +1,7 @@ +declare module 'aurelia-bootstrapper/index' { + export function bootstrap(configure: any): Promise<{}>; + +} +declare module 'aurelia-bootstrapper' { + export * from 'aurelia-bootstrapper/index'; +} diff --git a/src/Jackett.Web/typings/aurelia/aurelia-dependency-injection.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-dependency-injection.d.ts new file mode 100644 index 000000000..375c6ae74 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-dependency-injection.d.ts @@ -0,0 +1,345 @@ +declare module 'aurelia-dependency-injection' { + import core from 'core-js'; + import { Metadata, Decorators } from 'aurelia-metadata'; + import { AggregateError } from 'aurelia-logging'; + + /** + * Used to allow functions/classes to indicate that they should be registered as transients with the container. + * + * @class TransientRegistration + * @constructor + * @param {Object} [key] The key to register as. + */ + export class TransientRegistration { + constructor(key: any); + + /** + * Called by the container to register the annotated function/class as transient. + * + * @method register + * @param {Container} container The container to register with. + * @param {Object} key The key to register as. + * @param {Object} fn The function to register (target of the annotation). + */ + register(container: Container, key: any, fn: Function): any; + } + + /** + * Used to allow functions/classes to indicate that they should be registered as singletons with the container. + * + * @class SingletonRegistration + * @constructor + * @param {Object} [key] The key to register as. + */ + export class SingletonRegistration { + constructor(keyOrRegisterInChild: any, registerInChild?: boolean); + + /** + * Called by the container to register the annotated function/class as a singleton. + * + * @method register + * @param {Container} container The container to register with. + * @param {Object} key The key to register as. + * @param {Object} fn The function to register (target of the annotation). + */ + register(container: Container, key: any, fn: Function): any; + } + + /** + * An abstract resolver used to allow functions/classes to specify custom dependency resolution logic. + * + * @class Resolver + * @constructor + */ + export class Resolver { + + /** + * Called by the container to allow custom resolution of dependencies for a function/class. + * + * @method get + * @param {Container} container The container to resolve from. + * @return {Object} Returns the resolved object. + */ + get(container: Container): any; + } + + /** + * Used to allow functions/classes to specify lazy resolution logic. + * + * @class Lazy + * @constructor + * @extends Resolver + * @param {Object} key The key to lazily resolve. + */ + export class Lazy extends Resolver { + constructor(key: any); + + /** + * Called by the container to lazily resolve the dependency into a lazy locator function. + * + * @method get + * @param {Container} container The container to resolve from. + * @return {Function} Returns a function which can be invoked at a later time to obtain the actual dependency. + */ + get(container: Container): any; + + /** + * Creates a Lazy Resolver for the supplied key. + * + * @method of + * @static + * @param {Object} key The key to lazily resolve. + * @return {Lazy} Returns an insance of Lazy for the key. + */ + static of(key: any): Lazy; + } + + /** + * Used to allow functions/classes to specify resolution of all matches to a key. + * + * @class All + * @constructor + * @extends Resolver + * @param {Object} key The key to lazily resolve all matches for. + */ + export class All extends Resolver { + constructor(key: any); + + /** + * Called by the container to resolve all matching dependencies as an array of instances. + * + * @method get + * @param {Container} container The container to resolve from. + * @return {Object[]} Returns an array of all matching instances. + */ + get(container: Container): any[]; + + /** + * Creates an All Resolver for the supplied key. + * + * @method of + * @static + * @param {Object} key The key to resolve all instances for. + * @return {All} Returns an insance of All for the key. + */ + static of(key: any): All; + } + + /** + * Used to allow functions/classes to specify an optional dependency, which will be resolved only if already registred with the container. + * + * @class Optional + * @constructor + * @extends Resolver + * @param {Object} key The key to optionally resolve for. + * @param {Boolean} [checkParent=false] Indicates whether or not the parent container hierarchy should be checked. + */ + export class Optional extends Resolver { + constructor(key: any, checkParent?: boolean); + + /** + * Called by the container to provide optional resolution of the key. + * + * @method get + * @param {Container} container The container to resolve from. + * @return {Object} Returns the instance if found; otherwise null. + */ + get(container: Container): any; + + /** + * Creates an Optional Resolver for the supplied key. + * + * @method of + * @static + * @param {Object} key The key to optionally resolve for. + * @param {Boolean} [checkParent=false] Indicates whether or not the parent container hierarchy should be checked. + * @return {Optional} Returns an insance of Optional for the key. + */ + static of(key: any, checkParent?: boolean): Optional; + } + + /** + * Used to inject the dependency from the parent container instead of the current one. + * + * @class Parent + * @constructor + * @extends Resolver + * @param {Object} key The key to resolve from the parent container. + */ + export class Parent extends Resolver { + constructor(key: any); + + /** + * Called by the container to load the dependency from the parent container + * + * @method get + * @param {Container} container The container to resolve the parent from. + * @return {Function} Returns the matching instance from the parent container + */ + get(container: Container): any; + + /** + * Creates a Parent Resolver for the supplied key. + * + * @method of + * @static + * @param {Object} key The key to resolve. + * @return {Parent} Returns an insance of Parent for the key. + */ + static of(key: any): Parent; + } + + /** + * Used to instantiate a class. + * + * @class ClassActivator + * @constructor + */ + export class ClassActivator { + static instance: any; + invoke(fn: Function, args: any[]): any; + } + + /** + * Used to invoke a factory method. + * + * @class FactoryActivator + * @constructor + */ + export class FactoryActivator { + static instance: any; + invoke(fn: Function, args: any[]): any; + } + export var emptyParameters: any; + + /** + * A lightweight, extensible dependency injection container. + * + * @class Container + * @constructor + */ + export class Container { + constructor(constructionInfo?: Map); + + /** + * Makes this container instance globally reachable through Container.instance. + * + * @method makeGlobal + */ + makeGlobal(): Container; + + /** + * Registers an existing object instance with the container. + * + * @method registerInstance + * @param {Object} key The key that identifies the dependency at resolution time; usually a constructor function. + * @param {Object} instance The instance that will be resolved when the key is matched. + */ + registerInstance(key: any, instance: any): any; + + /** + * Registers a type (constructor function) such that the container returns a new instance for each request. + * + * @method registerTransient + * @param {Object} key The key that identifies the dependency at resolution time; usually a constructor function. + * @param {Function} [fn] The constructor function to use when the dependency needs to be instantiated. + */ + registerTransient(key: any, fn?: Function): any; + + /** + * Registers a type (constructor function) such that the container always returns the same instance for each request. + * + * @method registerSingleton + * @param {Object} key The key that identifies the dependency at resolution time; usually a constructor function. + * @param {Function} [fn] The constructor function to use when the dependency needs to be instantiated. + */ + registerSingleton(key: any, fn?: Function): any; + + /** + * Registers a type (constructor function) by inspecting its registration annotations. If none are found, then the default singleton registration is used. + * + * @method autoRegister + * @param {Function} fn The constructor function to use when the dependency needs to be instantiated. + * @param {Object} [key] The key that identifies the dependency at resolution time; usually a constructor function. + */ + autoRegister(fn: any, key?: any): any; + + /** + * Registers an array of types (constructor functions) by inspecting their registration annotations. If none are found, then the default singleton registration is used. + * + * @method autoRegisterAll + * @param {Function[]} fns The constructor function to use when the dependency needs to be instantiated. + */ + autoRegisterAll(fns: any[]): any; + + /** + * Registers a custom resolution function such that the container calls this function for each request to obtain the instance. + * + * @method registerHandler + * @param {Object} key The key that identifies the dependency at resolution time; usually a constructor function. + * @param {Function} handler The resolution function to use when the dependency is needed. It will be passed one arguement, the container instance that is invoking it. + */ + registerHandler(key: any, handler: ((c: Container) => any)): any; + + /** + * Unregisters based on key. + * + * @method unregister + * @param {Object} key The key that identifies the dependency at resolution time; usually a constructor function. + */ + unregister(key: any): any; + + /** + * Resolves a single instance based on the provided key. + * + * @method get + * @param {Object} key The key that identifies the object to resolve. + * @return {Object} Returns the resolved instance. + */ + get(key: any): any; + + /** + * Resolves all instance registered under the provided key. + * + * @method getAll + * @param {Object} key The key that identifies the objects to resolve. + * @return {Object[]} Returns an array of the resolved instances. + */ + getAll(key: any): any[]; + + /** + * Inspects the container to determine if a particular key has been registred. + * + * @method hasHandler + * @param {Object} key The key that identifies the dependency at resolution time; usually a constructor function. + * @param {Boolean} [checkParent=false] Indicates whether or not to check the parent container hierarchy. + * @return {Boolean} Returns true if the key has been registred; false otherwise. + */ + hasHandler(key: any, checkParent?: boolean): boolean; + + /** + * Creates a new dependency injection container whose parent is the current container. + * + * @method createChild + * @return {Container} Returns a new container instance parented to this. + */ + createChild(): Container; + + /** + * Invokes a function, recursively resolving its dependencies. + * + * @method invoke + * @param {Function} fn The function to invoke with the auto-resolved dependencies. + * @param {any[]} [deps] Additional function dependencies to use during invocation. + * @return {Object} Returns the instance resulting from calling the function. + */ + invoke(fn: Function, deps?: any[]): any; + } + export function autoinject(target?: any): any; + export function inject(...rest: any[]): any; + export function registration(value: any): any; + export function transient(key?: any): any; + export function singleton(keyOrRegisterInChild?: any, registerInChild?: boolean): any; + export function instanceActivator(value: any): any; + export function factory(): any; +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-event-aggregator.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-event-aggregator.d.ts new file mode 100644 index 000000000..fa09b1d72 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-event-aggregator.d.ts @@ -0,0 +1,15 @@ +declare module 'aurelia-event-aggregator' { + import * as LogManager from 'aurelia-logging'; + class Handler { + constructor(messageType: any, callback: any); + handle(message: any): any; + } + export class EventAggregator { + constructor(); + publish(event: string | any, data?: any): any; + subscribe(event: any, callback: any): any; + subscribeOnce(event: any, callback: any): any; + } + export function includeEventsIn(obj: any): any; + export function configure(aurelia: any): any; +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-fetch-client.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-fetch-client.d.ts new file mode 100644 index 000000000..13b8a2306 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-fetch-client.d.ts @@ -0,0 +1,139 @@ +declare module 'aurelia-fetch-client' { + import 'core-js'; + + /* eslint-disable */ + export interface Interceptor { + request(request: Request): Request | Response | Promise; + requestError(error: any): Request | Response | Promise; + response(response: Response): Response | Promise; + responseError(error: any): Response | Promise; + } + export interface RequestInit { + method?: string; + headers?: Headers; + body?: Blob | BufferSource | FormData | URLSearchParams | string; + mode?: string; + credentials?: string; + cache?: string; + } + + /** + * Create a Blob containing JSON-serialized data. + * Useful for easily creating JSON fetch request bodies. + * + * @param body - The object to be serialized to JSON. + */ + export function json(body: any): Blob; + + /** + * A class for configuring HttpClients. + * + * @constructor + */ + export class HttpClientConfiguration { + + /** + * The base URL to be prepended to each Request's url before sending. + */ + baseUrl: string; + + /** + * Default values to apply to init objects when creating Requests. Note that + * defaults cannot be applied when Request objects are manually created because + * Request provides its own defaults and discards the original init object. + * See also https://developer.mozilla.org/en-US/docs/Web/API/Request/Request + */ + defaults: RequestInit; + + /** + * Interceptors to be added to the HttpClient. + */ + interceptors: Interceptor[]; + + /** + * Sets the baseUrl. + * + * @param baseUrl - The base URL. + * @chainable + */ + withBaseUrl(baseUrl: string): HttpClientConfiguration; + + /** + * Sets the defaults. + * + * @param defaults - The defaults. + * @chainable + */ + withDefaults(defaults: RequestInit): HttpClientConfiguration; + + /** + * Adds an interceptor to be run on all requests or responses. + * + * @param interceptor - An object with request, requestError, + * response, or responseError methods. request and requestError act as + * resolve and reject handlers for the Request before it is sent. + * response and responseError act as resolve and reject handlers for + * the Response after it has been received. + * @chainable + */ + withInterceptor(interceptor: Interceptor): HttpClientConfiguration; + + /** + * Applies a configuration that addresses common application needs, including + * configuring same-origin credentials, and using rejectErrorResponses. + * + * @chainable + */ + useStandardConfiguration(): HttpClientConfiguration; + + /** + * Causes Responses whose status codes fall outside the range 200-299 to reject. + * The fetch API only rejects on network errors or other conditions that prevent + * the request from completing, meaning consumers must inspect Response.ok in the + * Promise continuation to determine if the server responded with a success code. + * This method adds a response interceptor that causes Responses with error codes + * to be rejected, which is common behavior in HTTP client libraries. + * + * @chainable + */ + rejectErrorResponses(): HttpClientConfiguration; + } + + /** + * An HTTP client based on the Fetch API. + * + * @constructor + */ + export class HttpClient { + activeRequestCount: number; + isRequesting: boolean; + interceptors: Interceptor[]; + isConfigured: boolean; + baseUrl: string; + defaults: RequestInit; + + /** + * Configure this client with default settings to be used by all requests. + * + * @param config - A function that takes a config argument, + * or a config object, or a string to use as the client's baseUrl. + * @chainable + */ + configure(config: string | RequestInit | ((config: HttpClientConfiguration) => void)): HttpClient; + + /** + * Starts the process of fetching a resource. Default configuration parameters + * will be applied to the Request. The constructed Request will be passed to + * registered request interceptors before being sent. The Response will be passed + * to registered Response interceptors before it is returned. + * + * See also https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API + * + * @param input - The resource that you wish to fetch. Either a + * Request object, or a string containing the URL of the resource. + * @param - An options object containing settings to be applied to + * the Request. + */ + fetch(input: Request | string, init?: any): Promise; + } +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-framework.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-framework.d.ts new file mode 100644 index 000000000..60b723712 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-framework.d.ts @@ -0,0 +1,222 @@ +declare module 'aurelia-framework' { + import core from 'core-js'; + import * as TheLogManager from 'aurelia-logging'; + import { Metadata } from 'aurelia-metadata'; + import { Container } from 'aurelia-dependency-injection'; + import { Loader } from 'aurelia-loader'; + import { join, relativeToFile } from 'aurelia-path'; + import { BindingLanguage, ViewEngine, ViewSlot, ResourceRegistry, CompositionEngine, Animator, DOMBoundary } from 'aurelia-templating'; + + /** + * Manages loading and configuring plugins. + * + * @class Plugins + * @constructor + * @param {Aurelia} aurelia An instance of Aurelia. + */ + export class Plugins { + constructor(aurelia: Aurelia); + + /** + * Configures an internal feature plugin before Aurelia starts. + * + * @method feature + * @param {string} plugin The folder for the internal plugin to configure (expects an index.js in that folder). + * @param {config} config The configuration for the specified plugin. + * @return {Plugins} Returns the current Plugins instance. + */ + feature(plugin: string, config: any): Plugins; + + /** + * Configures an external, 3rd party plugin before Aurelia starts. + * + * @method plugin + * @param {string} plugin The ID of the 3rd party plugin to configure. + * @param {config} config The configuration for the specified plugin. + * @return {Plugins} Returns the current Plugins instance. + */ + plugin(plugin: string, config: any): Plugins; + + /** + * Plugs in the default binding language from aurelia-templating-binding. + * + * @method defaultBindingLanguage + * @return {Plugins} Returns the current Plugins instance. + */ + defaultBindingLanguage(): Plugins; + + /** + * Plugs in the router from aurelia-templating-router. + * + * @method router + * @return {Plugins} Returns the current Plugins instance. + */ + router(): Plugins; + + /** + * Plugs in the default history implementation from aurelia-history-browser. + * + * @method history + * @return {Plugins} Returns the current Plugins instance. + */ + history(): Plugins; + + /** + * Plugs in the default templating resources (if, repeat, show, compose, etc.) from aurelia-templating-resources. + * + * @method defaultResources + * @return {Plugins} Returns the current Plugins instance. + */ + defaultResources(): Plugins; + + /** + * Plugs in the event aggregator from aurelia-event-aggregator. + * + * @method eventAggregator + * @return {Plugins} Returns the current Plugins instance. + */ + eventAggregator(): Plugins; + + /** + * Sets up the Aurelia configuration. This is equivalent to calling `.defaultBindingLanguage().defaultResources().history().router().eventAggregator();` + * + * @method standardConfiguration + * @return {Plugins} Returns the current Plugins instance. + */ + standardConfiguration(): Plugins; + + /** + * Plugs in the ConsoleAppender and sets the log level to debug. + * + * @method developmentLogging + * @return {Plugins} Returns the current Plugins instance. + */ + developmentLogging(): Plugins; + } + + /** + * The framework core that provides the main Aurelia object. + * + * @class Aurelia + * @constructor + * @param {Loader} loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader. + * @param {Container} container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container. + * @param {ResourceRegistry} resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. + */ + export class Aurelia { + loader: Loader; + container: Container; + resources: ResourceRegistry; + use: Plugins; + constructor(loader?: Loader, container?: Container, resources?: ResourceRegistry); + + /** + * Adds an existing object to the framework's dependency injection container. + * + * @method withInstance + * @param {Class} type The object type of the dependency that the framework will inject. + * @param {Object} instance The existing instance of the dependency that the framework will inject. + * @return {Aurelia} Returns the current Aurelia instance. + */ + withInstance(type: any, instance: any): Aurelia; + + /** + * Adds a singleton to the framework's dependency injection container. + * + * @method withSingleton + * @param {Class} type The object type of the dependency that the framework will inject. + * @param {Object} implementation The constructor function of the dependency that the framework will inject. + * @return {Aurelia} Returns the current Aurelia instance. + */ + withSingleton(type: any, implementation?: Function): Aurelia; + + /** + * Adds a transient to the framework's dependency injection container. + * + * @method withTransient + * @param {Class} type The object type of the dependency that the framework will inject. + * @param {Object} implementation The constructor function of the dependency that the framework will inject. + * @return {Aurelia} Returns the current Aurelia instance. + */ + withTransient(type: any, implementation?: Function): Aurelia; + + /** + * Adds globally available view resources to be imported into the Aurelia framework. + * + * @method globalizeResources + * @param {Object|Array} resources The relative module id to the resource. (Relative to the plugin's installer.) + * @return {Aurelia} Returns the current Aurelia instance. + */ + globalizeResources(resources: string | string[]): Aurelia; + + /** + * Renames a global resource that was imported. + * + * @method renameGlobalResource + * @param {String} resourcePath The path to the resource. + * @param {String} newName The new name. + * @return {Aurelia} Returns the current Aurelia instance. + */ + renameGlobalResource(resourcePath: string, newName: string): Aurelia; + + /** + * Adds an async function that runs before the plugins are run. + * + * @method addPreStartTask + * @param {Function} task The function to run before start. + * @return {Aurelia} Returns the current Aurelia instance. + */ + addPreStartTask(task: Function): Aurelia; + + /** + * Adds an async function that runs after the plugins are run. + * + * @method addPostStartTask + * @param {Function} task The function to run after start. + * @return {Aurelia} Returns the current Aurelia instance. + */ + addPostStartTask(task: Function): Aurelia; + + /** + * Loads plugins, then resources, and then starts the Aurelia instance. + * + * @method start + * @return {Promise} Returns the started Aurelia instance. + */ + start(): Promise; + + /** + * Enhances the host's existing elements with behaviors and bindings. + * + * @method enhance + * @param {Object} bindingContext A binding context for the enhanced elements. + * @param {string|Object} applicationHost The DOM object that Aurelia will enhance. + * @return {Promise} Returns the current Aurelia instance. + */ + enhance(bindingContext?: Object, applicationHost?: any): Promise; + + /** + * Instantiates the root view-model and view and add them to the DOM. + * + * @method setRoot + * @param {Object} root The root view-model to load upon bootstrap. + * @param {string|Object} applicationHost The DOM object that Aurelia will attach to. + * @return {Promise} Returns the current Aurelia instance. + */ + setRoot(root?: string, applicationHost?: any): Promise; + } + + /** + * The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform. + * + * @module framework + */ + export * from 'aurelia-dependency-injection'; + export * from 'aurelia-binding'; + export * from 'aurelia-metadata'; + export * from 'aurelia-templating'; + export * from 'aurelia-loader'; + export * from 'aurelia-task-queue'; + export * from 'aurelia-path'; + export var LogManager: any; +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-history-browser.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-history-browser.d.ts new file mode 100644 index 000000000..403eb7dd9 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-history-browser.d.ts @@ -0,0 +1,16 @@ +declare module 'aurelia-history-browser' { + import * as core from 'core-js'; + import { History } from 'aurelia-history'; + export class BrowserHistory extends History { + constructor(); + getHash(window?: Window): string; + getFragment(fragment: string, forcePushState?: boolean): string; + activate(options?: Object): boolean; + deactivate(): void; + checkUrl(): boolean; + loadUrl(fragmentOverride: string): boolean; + navigate(fragment?: string, options?: Object): boolean; + navigateBack(): void; + } + export function configure(aurelia: Object): void; +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-history.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-history.d.ts new file mode 100644 index 000000000..48a25d640 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-history.d.ts @@ -0,0 +1,8 @@ +declare module 'aurelia-history' { + export class History { + activate(options: Object): boolean; + deactivate(): void; + navigate(fragment: string, options: Object): boolean; + navigateBack(): void; + } +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-http-client.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-http-client.d.ts new file mode 100644 index 000000000..866682560 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-http-client.d.ts @@ -0,0 +1,203 @@ +declare module 'aurelia-http-client' { + import core from 'core-js'; + import { join, buildQueryString } from 'aurelia-path'; + export class Headers { + constructor(headers?: any); + add(key: any, value: any): any; + get(key: any): any; + clear(): any; + configureXHR(xhr: any): any; + + /** + * XmlHttpRequest's getAllResponseHeaders() method returns a string of response + * headers according to the format described here: + * http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders-method + * This method parses that string into a user-friendly key/value pair object. + */ + static parse(headerStr: any): any; + } + export class RequestMessage { + constructor(method: any, url: any, content: any, headers: any); + buildFullUrl(): any; + } + + /*jshint -W093 */ + export class HttpResponseMessage { + constructor(requestMessage: any, xhr: any, responseType: any, reviver: any); + content(): any; + } + + /** + * MimeTypes mapped to responseTypes + * + * @type {Object} + */ + export var mimeTypes: any; + export class RequestMessageProcessor { + constructor(xhrType: any, xhrTransformers: any); + abort(): any; + process(client: any, message: any): any; + } + export function timeoutTransformer(client: any, processor: any, message: any, xhr: any): any; + export function callbackParameterNameTransformer(client: any, processor: any, message: any, xhr: any): any; + export function credentialsTransformer(client: any, processor: any, message: any, xhr: any): any; + export function progressTransformer(client: any, processor: any, message: any, xhr: any): any; + export function responseTypeTransformer(client: any, processor: any, message: any, xhr: any): any; + export function headerTransformer(client: any, processor: any, message: any, xhr: any): any; + export function contentTransformer(client: any, processor: any, message: any, xhr: any): any; + export class JSONPRequestMessage extends RequestMessage { + constructor(url: any, callbackParameterName: any); + } + class JSONPXHR { + open(method: any, url: any): any; + send(): any; + abort(): any; + setRequestHeader(): any; + } + export function createJSONPRequestMessageProcessor(): any; + export class HttpRequestMessage extends RequestMessage { + constructor(method: any, url: any, content: any, headers: any); + } + export function createHttpRequestMessageProcessor(): any; + + /** + * A builder class allowing fluent composition of HTTP requests. + * + * @class RequestBuilder + * @constructor + */ + export class RequestBuilder { + constructor(client: any); + + /** + * Adds a user-defined request transformer to the RequestBuilder. + * + * @method addHelper + * @param {String} name The name of the helper to add. + * @param {Function} fn The helper function. + * @chainable + */ + static addHelper(name: any, fn: any): any; + + /** + * Sends the request. + * + * @method send + * @return {Promise} A cancellable promise object. + */ + send(): any; + } + + /** + * The main HTTP client object. + * + * @class HttpClient + * @constructor + */ + export class HttpClient { + constructor(); + + /** + * Configure this HttpClient with default settings to be used by all requests. + * + * @method configure + * @param {Function} fn A function that takes a RequestBuilder as an argument. + * @chainable + */ + configure(fn: any): any; + + /** + * Returns a new RequestBuilder for this HttpClient instance that can be used to build and send HTTP requests. + * + * @method createRequest + * @param url The target URL. + * @type RequestBuilder + */ + createRequest(url: any): any; + + /** + * Sends a message using the underlying networking stack. + * + * @method send + * @param message A configured HttpRequestMessage or JSONPRequestMessage. + * @param {Array} transformers A collection of transformers to apply to the HTTP request. + * @return {Promise} A cancellable promise object. + */ + send(message: any, transformers: any): any; + + /** + * Sends an HTTP DELETE request. + * + * @method delete + * @param {String} url The target URL. + * @return {Promise} A cancellable promise object. + */ + delete(url: any): any; + + /** + * Sends an HTTP GET request. + * + * @method get + * @param {String} url The target URL. + * @return {Promise} A cancellable promise object. + */ + get(url: any): any; + + /** + * Sends an HTTP HEAD request. + * + * @method head + * @param {String} url The target URL. + * @return {Promise} A cancellable promise object. + */ + head(url: any): any; + + /** + * Sends a JSONP request. + * + * @method jsonp + * @param {String} url The target URL. + * @return {Promise} A cancellable promise object. + */ + jsonp(url: any, callbackParameterName?: any): any; + + /** + * Sends an HTTP OPTIONS request. + * + * @method options + * @param {String} url The target URL. + * @return {Promise} A cancellable promise object. + */ + options(url: any): any; + + /** + * Sends an HTTP PUT request. + * + * @method put + * @param {String} url The target URL. + * @param {Object} url The request payload. + * @return {Promise} A cancellable promise object. + */ + put(url: any, content: any): any; + + /** + * Sends an HTTP PATCH request. + * + * @method patch + * @param {String} url The target URL. + * @param {Object} url The request payload. + * @return {Promise} A cancellable promise object. + */ + patch(url: any, content: any): any; + + /** + * Sends an HTTP POST request. + * + * @method post + * @param {String} url The target URL. + * @param {Object} url The request payload. + * @return {Promise} A cancellable promise object. + */ + post(url: any, content: any): any; + } +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-loader-default.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-loader-default.d.ts new file mode 100644 index 000000000..8debbf1ea --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-loader-default.d.ts @@ -0,0 +1,11 @@ +declare module 'aurelia-loader-default' { + import { Origin } from 'aurelia-metadata'; + import { Loader } from 'aurelia-loader'; + export class DefaultLoader extends Loader { + constructor(); + loadModule(id: any): any; + loadAllModules(ids: any): any; + loadTemplate(url: any): any; + loadText(url: any): any; + } +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-loader.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-loader.d.ts new file mode 100644 index 000000000..dd7205730 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-loader.d.ts @@ -0,0 +1,30 @@ +declare module 'aurelia-loader' { + import core from 'core-js'; + import { relativeToFile } from 'aurelia-path'; + import { Origin } from 'aurelia-metadata'; + export class TemplateDependency { + constructor(src: string, name?: string); + } + export class TemplateRegistryEntry { + constructor(id: string); + templateIsLoaded(): boolean; + isReady(): boolean; + setTemplate(template: Element): void; + addDependency(src: string | Function, name?: string): void; + setResources(resources: any): void; + setFactory(factory: any): void; + } + export class Loader { + constructor(); + loadModule(id: any): any; + loadAllModules(ids: any): any; + loadTemplate(url: any): any; + loadText(url: any): any; + getOrCreateTemplateRegistryEntry(id: any): any; + importDocument(url: any): any; + importBundle(link: any): any; + importTemplate(url: any): any; + findTemplate(doc: any, url: any): any; + findBundledTemplate(name: any, entry: any): any; + } +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-logging-console.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-logging-console.d.ts new file mode 100644 index 000000000..dcfe1e68a --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-logging-console.d.ts @@ -0,0 +1,8 @@ +declare module 'aurelia-logging-console' { + export class ConsoleAppender { + debug(logger: Object, ...rest: any[]): void; + info(logger: Object, ...rest: any[]): void; + warn(logger: Object, ...rest: any[]): void; + error(logger: Object, ...rest: any[]): void; + } +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-logging.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-logging.d.ts new file mode 100644 index 000000000..d1bec226d --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-logging.d.ts @@ -0,0 +1,103 @@ +declare module 'aurelia-logging' { + + /** + * This library is part of the Aurelia platform and contains a minimal but effective logging mechanism + * with support for log levels and pluggable log appenders. + * + * @module logging + */ + /** + * Creates an instance of Error that aggregates and preserves an innerError. + * + * @class AggregateError + * @constructor + */ + export function AggregateError(msg: string, inner?: Error, skipIfAlreadyAggregate?: boolean): Error; + + /** + * Enum specifying the levels of the logger + * + * @property logLevel + * @type Enum + * @for export + */ + export var logLevel: any; + + /** + * Gets an instance of a logger by the Id used when creating. + * + * @method getLogger + * @param {string} id The id of the logger you wish to get an instance of. + * @return {Logger} The instance of the logger, or creates a new logger if none exists for that Id. + * @for export + */ + export function getLogger(id: string): Logger; + + /** + * Adds an appender capable of processing logs and channeling them to an output. + * + * @method addAppender + * @param {Object} appender An appender instance to begin processing logs with. + * @for export + */ + export function addAppender(appender: Object): void; + + /** + * Sets the level of the logging for the application loggers + * + * @method setLevel + * @param {Number} level Matches an enum specifying the level of logging. + * @for export + */ + export function setLevel(level: number): void; + + /** + * The logger is essentially responsible for having log statements that appear during debugging but are squelched + * when using the build tools, depending on the log level that is set. The available levels are - + * 1. none + * 2. error + * 3. warn + * 4. info + * 5. debug + * + * You cannot instantiate the logger directly - you must use the getLogger method instead. + * + * @class Logger + * @constructor + */ + export class Logger { + constructor(id: string, key: Object); + + /** + * Logs a debug message. + * + * @method debug + * @param {string} message The message to log + */ + debug(message: string): void; + + /** + * Logs info. + * + * @method info + * @param {string} message The message to log + */ + info(message: string): void; + + /** + * Logs a warning. + * + * @method warn + * @param {string} message The message to log + */ + warn(message: string): void; + + /** + * Logs an error. + * + * @method error + * @param {string} message The message to log + */ + error(message: string): void; + } +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-metadata.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-metadata.d.ts new file mode 100644 index 000000000..dd0285c45 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-metadata.d.ts @@ -0,0 +1,49 @@ +declare module 'aurelia-metadata' { + import core from 'core-js'; + + /** + * Provides helpers for working with metadata. + * + * @class Metadata + * @static + */ + export var Metadata: any; + + /** + * A metadata annotation that describes the origin module of the function to which it's attached. + * + * @class Origin + * @constructor + * @param {string} moduleId The origin module id. + * @param {string} moduleMember The name of the export in the origin module. + */ + export class Origin { + constructor(moduleId: string, moduleMember: string); + + /** + * Get the Origin annotation for the specified function. + * + * @method get + * @static + * @param {Function} fn The function to inspect for Origin metadata. + * @return {Origin} Returns the Origin metadata. + */ + static get(fn: Function): any; + + /** + * Set the Origin annotation for the specified function. + * + * @method set + * @static + * @param {Function} fn The function to set the Origin metadata on. + * @param {origin} fn The Origin metadata to store on the function. + * @return {Origin} Returns the Origin metadata. + */ + static set(fn: Function, origin: Origin): any; + } + export class DecoratorApplicator { + constructor(); + decorator(decorator: Function): DecoratorApplicator; + } + export var Decorators: any; +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-path.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-path.d.ts new file mode 100644 index 000000000..a809d77b2 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-path.d.ts @@ -0,0 +1,5 @@ +declare module 'aurelia-path' { + export function relativeToFile(name: string, file: string): string; + export function join(path1: string, path2: string): string; + export function buildQueryString(a: Object, traditional?: boolean): string; +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-route-recognizer.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-route-recognizer.d.ts new file mode 100644 index 000000000..b5e7ed87e --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-route-recognizer.d.ts @@ -0,0 +1,168 @@ +declare module 'aurelia-route-recognizer' { + import core from 'core-js'; + export interface RouteHandler { + name: string; + } + export interface ConfigurableRoute { + path: string; + handler: RouteHandler; + } + export interface HandlerEntry { + handler: RouteHandler; + names: string[]; + } + export interface RecognizedRoute { + handler: RouteHandler; + params: Object; + isDynamic: boolean; + } + export interface CharSpec { + invalidChars?: string; + validChars?: string; + repeat?: boolean; + } + + // A State has a character specification and (`charSpec`) and a list of possible + // subsequent states (`nextStates`). + // + // If a State is an accepting state, it will also have several additional + // properties: + // + // * `regex`: A regular expression that is used to extract parameters from paths + // that reached this accepting state. + // * `handlers`: Information on how to convert the list of captures into calls + // to registered handlers with the specified parameters. + // * `types`: How many static, dynamic, or star segments in this route. Used to + // decide which route to use if multiple registered routes match a path. + // + // Currently, State is implemented naively by looping over `nextStates` and + // comparing a character specification against a character. A more efficient + // implementation would use a hash of keys pointing at one or more next states. + export class State { + constructor(charSpec: CharSpec); + get(charSpec: CharSpec): State; + put(charSpec: CharSpec): State; + + // Find a list of child states matching the next character + match(ch: string): State[]; + } + + // A Segment represents a segment in the original route description. + // Each Segment type provides an `eachChar` and `regex` method. + // + // The `eachChar` method invokes the callback with one or more character + // specifications. A character specification consumes one or more input + // characters. + // + // The `regex` method returns a regex fragment for the segment. If the + // segment is a dynamic or star segment, the regex fragment also includes + // a capture. + // + // A character specification contains: + // + // * `validChars`: a String with a list of all valid characters, or + // * `invalidChars`: a String with a list of all invalid characters + // * `repeat`: true if the character specification can repeat + export class StaticSegment { + constructor(string: string); + eachChar(callback: ((spec: CharSpec) => void)): any; + regex(): string; + generate(params: Object, consumed: Object): string; + } + export class DynamicSegment { + constructor(name: string); + eachChar(callback: ((spec: CharSpec) => void)): any; + regex(): string; + generate(params: Object, consumed: Object): string; + } + export class StarSegment { + constructor(name: string); + eachChar(callback: ((spec: CharSpec) => void)): any; + regex(): string; + generate(params: Object, consumed: Object): string; + } + export class EpsilonSegment { + eachChar(callback: ((spec: CharSpec) => void)): any; + regex(): string; + generate(params: Object, consumed: Object): string; + } + + /** + * Class that parses route patterns and matches path strings. + * + * @class RouteRecognizer + * @constructor + */ + export class RouteRecognizer { + constructor(); + + /** + * Parse a route pattern and add it to the collection of recognized routes. + * + * @method add + * @param {Object} route The route to add. + */ + add(route: ConfigurableRoute | ConfigurableRoute[]): State; + + /** + * Retrieve the handlers registered for the named route. + * + * @method handlersFor + * @param {String} name The name of the route. + * @return {Array} The handlers. + */ + handlersFor(name: string): HandlerEntry[]; + + /** + * Check if this RouteRecognizer recognizes a named route. + * + * @method hasRoute + * @param {String} name The name of the route. + * @return {Boolean} True if the named route is recognized. + */ + hasRoute(name: string): boolean; + + /** + * Generate a path and query string from a route name and params object. + * + * @method generate + * @param {String} name The name of the route. + * @param {Object} params The route params to use when populating the pattern. + * Properties not required by the pattern will be appended to the query string. + * @return {String} The generated absolute path and query string. + */ + generate(name: string, params: Object): string; + + /** + * Generate a query string from an object. + * + * @method generateQueryString + * @param {Object} params Object containing the keys and values to be used. + * @return {String} The generated query string, including leading '?'. + */ + generateQueryString(params: Object): string; + + /** + * Parse a query string. + * + * @method parseQueryString + * @param {String} The query string to parse. + * @return {Object} Object with keys and values mapped from the query string. + */ + parseQueryString(queryString: string): Object; + + /** + * Match a path string against registered route patterns. + * + * @method recognize + * @param {String} path The path to attempt to match. + * @return {Array} Array of objects containing `handler`, `params`, and + * `isDynanic` values for the matched route(s), or undefined if no match + * was found. + */ + recognize(path: string): RecognizedRoute[]; + } + class RecognizeResults { + constructor(queryParams: Object); + } +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-router.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-router.d.ts new file mode 100644 index 000000000..93a8188eb --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-router.d.ts @@ -0,0 +1,201 @@ +declare module 'aurelia-router' { + import * as core from 'core-js'; + import * as LogManager from 'aurelia-logging'; + import { Container } from 'aurelia-dependency-injection'; + import { RouteRecognizer } from 'aurelia-route-recognizer'; + import { join } from 'aurelia-path'; + import { History } from 'aurelia-history'; + import { EventAggregator } from 'aurelia-event-aggregator'; + export class RouteFilterContainer { + static inject(): any; + constructor(container: any); + addStep(name: any, step: any, index?: any): any; + getFilterSteps(name: any): any; + } + export function createRouteFilterStep(name: any): any; + class RouteFilterStep { + constructor(name: any, routeFilterContainer: any); + getSteps(): any; + } + export const pipelineStatus: any; + export class Pipeline { + constructor(); + withStep(step: any): any; + run(ctx: any): any; + } + export class NavigationInstruction { + fragment: string; + queryString: string; + params: any; + queryParams: any; + config: any; + parentInstruction: NavigationInstruction; + constructor(fragment: string, queryString?: string, params?: any, queryParams?: any, config?: any, parentInstruction?: NavigationInstruction); + addViewPortInstruction(viewPortName: any, strategy: any, moduleId: any, component: any): any; + getWildCardName(): string; + getWildcardPath(): string; + getBaseUrl(): string; + } + + /** + * Class for storing and interacting with a route's navigation settings + * + * @class NavModel + * @constructor + */ + export class NavModel { + constructor(router: any, relativeHref: any); + + /** + * Sets the route's title and updates document.title. + * If the a navigation is in progress, the change will be applied + * to document.title when the navigation completes. + * + * @method setTitle + * @param {String} title The new title. + */ + setTitle(title: any): any; + } + export function processPotential(obj: any, resolve: any, reject: any): any; + export function normalizeAbsolutePath(path: any, hasPushState: any): any; + export function createRootedPath(fragment: any, baseUrl: any, hasPushState: any): any; + export function resolveUrl(fragment: any, baseUrl: any, hasPushState: any): any; + + /** + * Determines if the provided object is a navigation command. + * A navigation command is anything with a navigate method. + * @param {object} obj The item to check. + * @return {boolean} + */ + export function isNavigationCommand(obj: any): any; + + /** + * Used during the activation lifecycle to cause a redirect. + * + * @class Redirect + * @constructor + * @param {String} url The url to redirect to. + */ + export class Redirect { + constructor(url: any, options: any); + + /** + * Called by the activation system to set the child router. + * + * @method setRouter + * @param {Router} router + */ + setRouter(router: any): any; + + /** + * Called by the navigation pipeline to navigate. + * + * @method navigate + * @param {Router} appRouter - a router which should redirect + */ + navigate(appRouter: any): any; + } + export class RouterConfiguration { + instructions: any; + options: any; + pipelineSteps: any; + title: any; + unknownRouteConfig: any; + addPipelineStep(name: any, step: any): any; + map(route: any): any; + mapRoute(config: any): any; + mapUnknownRoutes(config: any): any; + exportToRouter(router: any): any; + } + export const activationStrategy: any; + export function buildNavigationPlan(navigationContext: any, forceLifecycleMinimum: any): any; + export class BuildNavigationPlanStep { + run(navigationContext: any, next: any): any; + } + export var affirmations: any; + export class CanDeactivatePreviousStep { + run(navigationContext: any, next: any): any; + } + export class CanActivateNextStep { + run(navigationContext: any, next: any): any; + } + export class DeactivatePreviousStep { + run(navigationContext: any, next: any): any; + } + export class ActivateNextStep { + run(navigationContext: any, next: any): any; + } + export class NavigationContext { + constructor(router: any, nextInstruction: any); + getAllContexts(acc?: any): any; + nextInstructions(): any; + currentInstructions(): any; + prevInstructions(): any; + commitChanges(waitToSwap: any): any; + updateTitle(): any; + buildTitle(separator?: any): any; + } + export class CommitChangesStep { + run(navigationContext: any, next: any): any; + } + export class RouteLoader { + loadRoute(router: any, config: any): any; + } + export class LoadRouteStep { + static inject(): any; + constructor(routeLoader: any); + run(navigationContext: any, next: any): any; + } + export function loadNewRoute(routeLoader: any, navigationContext: any): any; + export class Router { + container: any; + history: any; + viewPorts: any; + baseUrl: string; + isConfigured: boolean; + fallbackOrder: number; + recognizer: RouteRecognizer; + childRecognizer: RouteRecognizer; + routes: any[]; + isNavigating: boolean; + navigation: any[]; + currentInstruction: NavigationInstruction; + constructor(container: any, history: any); + isRoot(): any; + registerViewPort(viewPort: Object, name?: string): any; + refreshBaseUrl(): any; + refreshNavigation(): any; + configure(callbackOrConfig: RouterConfiguration | ((config: RouterConfiguration) => RouterConfiguration)): Router; + navigate(fragment: string, options?: Object): boolean; + navigateToRoute(route: string, params?: Object, options?: Object): boolean; + navigateBack(): any; + createChild(container?: Container): Router; + createNavigationInstruction(url?: string, parentInstruction?: NavigationInstruction): Promise; + createNavigationContext(instruction: NavigationInstruction): NavigationContext; + generate(name: string, params?: Object): string; + createNavModel(config: Object): NavModel; + addRoute(config: Object, navModel?: NavModel): any; + hasRoute(name: string): boolean; + hasOwnRoute(name: string): boolean; + handleUnknownRoutes(config?: string | Function | Object): any; + updateTitle(): any; + reset(): any; + } + export class PipelineProvider { + static inject(): any; + constructor(container: any); + createPipeline(navigationContext: any): any; + } + export class AppRouter extends Router { + static inject(): any; + constructor(container: any, history: any, pipelineProvider: any, events: any); + isRoot(): any; + loadUrl(url: any): any; + queueInstruction(instruction: any): any; + dequeueInstruction(instructionCount?: any): any; + registerViewPort(viewPort: any, name: any): any; + activate(options: any): any; + deactivate(): any; + reset(): any; + } +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-skeleton-navigation.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-skeleton-navigation.d.ts new file mode 100644 index 000000000..a7c342610 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-skeleton-navigation.d.ts @@ -0,0 +1,51 @@ +declare module 'aurelia-skeleton-navigation/animation-main' { + export function configure(aurelia: any): void; + +} +declare module 'aurelia-skeleton-navigation/app' { + import { Router } from 'aurelia-router'; + export class App { + router: Router; + configureRouter(config: any, router: any): void; + } + +} +declare module 'aurelia-skeleton-navigation/child-router' { + import { Router } from 'aurelia-router'; + export class ChildRouter { + router: Router; + configureRouter(config: any, router: any): void; + } + +} +declare module 'aurelia-skeleton-navigation/flickr' { + export class Flickr { + heading: string; + images: any[]; + http: any; + url: string; + constructor(http: any); + activate(): any; + canDeactivate(): boolean; + } + +} +declare module 'aurelia-skeleton-navigation/nav-bar' { + export class NavBar { + router: any; + } + +} +declare module 'aurelia-skeleton-navigation/welcome' { + export class Welcome { + heading: string; + firstName: string; + lastName: string; + fullName: string; + welcome(): void; + } + export class UpperValueConverter { + toView(value: any): any; + } + +} diff --git a/src/Jackett.Web/typings/aurelia/aurelia-skeleton-plugin.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-skeleton-plugin.d.ts new file mode 100644 index 000000000..c60e1f653 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-skeleton-plugin.d.ts @@ -0,0 +1,12 @@ +declare module 'aurelia-skeleton-plugin/hello-world' { + export class HelloWorld { + } + +} +declare module 'aurelia-skeleton-plugin/index' { + export function configure(aurelia: any): void; + +} +declare module 'aurelia-skeleton-plugin' { + export * from 'aurelia-skeleton-plugin/index'; +} diff --git a/src/Jackett.Web/typings/aurelia/aurelia-task-queue.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-task-queue.d.ts new file mode 100644 index 000000000..3d5be16b7 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-task-queue.d.ts @@ -0,0 +1,10 @@ +declare module 'aurelia-task-queue' { + export class TaskQueue { + constructor(); + queueMicroTask(task: any): any; + queueTask(task: any): any; + flushTaskQueue(): any; + flushMicroTaskQueue(): any; + onError(error: any, task: any): any; + } +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-templating-binding.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-templating-binding.d.ts new file mode 100644 index 000000000..a377d5a6e --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-templating-binding.d.ts @@ -0,0 +1,40 @@ +declare module 'aurelia-templating-binding' { + import * as LogManager from 'aurelia-logging'; + import { Parser, ObserverLocator, EventManager, ListenerExpression, BindingExpression, NameExpression, CallExpression, bindingMode } from 'aurelia-binding'; + import { BindingLanguage } from 'aurelia-templating'; + export class SyntaxInterpreter { + static inject(): any; + constructor(parser: any, observerLocator: any, eventManager: any); + interpret(resources: any, element: any, info: any, existingInstruction: any): any; + handleUnknownCommand(resources: any, element: any, info: any, existingInstruction: any): any; + determineDefaultBindingMode(element: any, attrName: any): any; + bind(resources: any, element: any, info: any, existingInstruction: any): any; + trigger(resources: any, element: any, info: any): any; + delegate(resources: any, element: any, info: any): any; + call(resources: any, element: any, info: any, existingInstruction: any): any; + options(resources: any, element: any, info: any, existingInstruction: any): any; + } + export class TemplatingBindingLanguage extends BindingLanguage { + static inject(): any; + constructor(parser: any, observerLocator: any, syntaxInterpreter: any); + inspectAttribute(resources: any, attrName: any, attrValue: any): any; + createAttributeInstruction(resources: any, element: any, info: any, existingInstruction: any): any; + parseText(resources: any, value: any): any; + parseContent(resources: any, attrName: any, attrValue: any): any; + } + export class InterpolationBindingExpression { + constructor(observerLocator: any, targetProperty: any, parts: any, mode: any, valueConverterLookupFunction: any, attribute: any); + createBinding(target: any): any; + } + class InterpolationBinding { + constructor(observerLocator: any, parts: any, target: any, targetProperty: any, mode: any, valueConverterLookupFunction: any); + getObserver(obj: any, propertyName: any): any; + bind(source: any): any; + setValue(): any; + partChanged(newValue: any, oldValue: any, connecting: any): any; + connect(): any; + interpolate(): any; + unbind(): any; + } + export function configure(aurelia: any): any; +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-templating-resources.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-templating-resources.d.ts new file mode 100644 index 000000000..29d431eb7 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-templating-resources.d.ts @@ -0,0 +1,130 @@ +declare module 'aurelia-templating-resources/compose' { + export class Compose { + element: any; + container: any; + compositionEngine: any; + viewSlot: any; + viewResources: any; + taskQueue: any; + executionContext: any; + view: any; + viewModel: any; + model: any; + currentInstruction: any; + currentViewModel: any; + constructor(element: any, container: any, compositionEngine: any, viewSlot: any, viewResources: any, taskQueue: any); + bind(executionContext: any): void; + modelChanged(newValue: any, oldValue: any): void; + viewChanged(newValue: any, oldValue: any): void; + viewModelChanged(newValue: any, oldValue: any): void; + } + +} +declare module 'aurelia-templating-resources/global-behavior' { + export class GlobalBehavior { + element: any; + handler: any; + aureliaCommand: any; + aureliaAttrName: any; + static handlers: any; + static createSettingsFromBehavior: any; + static jQueryPlugins: any; + constructor(element: any); + bind(): void; + attached(): void; + detached(): void; + unbind(): void; + } + +} +declare module 'aurelia-templating-resources/if' { + export class If { + viewFactory: any; + viewSlot: any; + showing: any; + view: any; + constructor(viewFactory: any, viewSlot: any); + valueChanged(newValue: any): void; + } + +} +declare module 'aurelia-templating-resources/with' { + export class With { + viewFactory: any; + viewSlot: any; + view: any; + constructor(viewFactory: any, viewSlot: any); + valueChanged(newValue: any): void; + } + +} +declare module 'aurelia-templating-resources/repeat' { + export class Repeat { + viewFactory: any; + viewSlot: any; + observerLocator: any; + local: any; + key: any; + value: any; + items: any; + executionContext: any; + oldItems: any; + disposeSubscription: any; + lastBoundItems: any; + constructor(viewFactory: any, viewSlot: any, observerLocator: any); + bind(executionContext: any): void; + unbind(): void; + itemsChanged(): void; + processItems(): void; + processArrayItems(items: any): void; + processMapEntries(items: any): void; + processNumber(value: any): void; + createBaseExecutionContext(data: any): any; + createBaseExecutionKvpContext(key: any, value: any): any; + createFullExecutionContext(data: any, index: any, length: any): any; + createFullExecutionKvpContext(key: any, value: any, index: any, length: any): any; + updateExecutionContext(context: any, index: any, length: any): any; + handleSplices(array: any, splices: any): void; + handleMapChangeRecords(map: any, records: any): void; + getViewIndexByKey(key: any): any; + } + +} +declare module 'aurelia-templating-resources/show' { + export class Show { + element: any; + constructor(element: any); + valueChanged(newValue: any): void; + } + +} +declare module 'aurelia-templating-resources/sanitize-html' { + export class SanitizeHtmlValueConverter { + static defaultSanitizer(untrustedMarkup: any): any; + sanitizer: any; + constructor(); + toView(untrustedMarkup: any): any; + } + +} +declare module 'aurelia-templating-resources/replaceable' { + export class Replaceable { + constructor(viewFactory: any, viewSlot: any); + } + +} +declare module 'aurelia-templating-resources/index' { + export function configure(aurelia: any): void; + export { Compose } from 'aurelia-templating-resources/compose'; + export { If } from 'aurelia-templating-resources/if'; + export { With } from 'aurelia-templating-resources/with'; + export { Repeat } from 'aurelia-templating-resources/repeat'; + export { Show } from 'aurelia-templating-resources/show'; + export { GlobalBehavior } from 'aurelia-templating-resources/global-behavior'; + export { SanitizeHtmlValueConverter } from 'aurelia-templating-resources/sanitize-html'; + export { Replaceable } from 'aurelia-templating-resources/replaceable'; + +} +declare module 'aurelia-templating-resources' { + export * from 'aurelia-templating-resources/index'; +} diff --git a/src/Jackett.Web/typings/aurelia/aurelia-templating-router.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-templating-router.d.ts new file mode 100644 index 000000000..d9ac7acf4 --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-templating-router.d.ts @@ -0,0 +1,47 @@ +declare module 'aurelia-templating-router/route-loader' { + import { RouteLoader } from 'aurelia-router'; + export class TemplatingRouteLoader extends RouteLoader { + compositionEngine: any; + constructor(compositionEngine: any); + loadRoute(router: any, config: any): any; + } + +} +declare module 'aurelia-templating-router/router-view' { + export class RouterView { + element: any; + container: any; + viewSlot: any; + router: any; + view: any; + constructor(element: any, container: any, viewSlot: any, router: any); + bind(executionContext: any): void; + process(viewPortInstruction: any, waitToSwap: any): any; + swap(viewPortInstruction: any): void; + } + +} +declare module 'aurelia-templating-router/route-href' { + export class RouteHref { + router: any; + element: any; + route: any; + params: any; + attribute: any; + constructor(router: any, element: any); + bind(): void; + attributeChanged(value: any, previous: any): void; + processChange(): void; + } + +} +declare module 'aurelia-templating-router/index' { + export function configure(aurelia: any): void; + export { TemplatingRouteLoader } from 'aurelia-templating-router/route-loader'; + export { RouterView } from 'aurelia-templating-router/router-view'; + export { RouteHref } from 'aurelia-templating-router/route-href'; + +} +declare module 'aurelia-templating-router' { + export * from 'aurelia-templating-router/index'; +} diff --git a/src/Jackett.Web/typings/aurelia/aurelia-templating.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-templating.d.ts new file mode 100644 index 000000000..eeac85a2d --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-templating.d.ts @@ -0,0 +1,318 @@ +declare module 'aurelia-templating' { + import core from 'core-js'; + import * as LogManager from 'aurelia-logging'; + import { Metadata, Origin, Decorators } from 'aurelia-metadata'; + import { relativeToFile } from 'aurelia-path'; + import { TemplateRegistryEntry, Loader } from 'aurelia-loader'; + import { Container } from 'aurelia-dependency-injection'; + import { bindingMode, ObserverLocator, BindingExpression, Binding, ValueConverterResource, EventManager } from 'aurelia-binding'; + import { TaskQueue } from 'aurelia-task-queue'; + export let DOMBoundary: any; + export function createTemplateFromMarkup(markup: any): any; + export function replaceNode(newNode: any, node: any, parentNode: any): any; + export function removeNode(node: any, parentNode: any): any; + export const animationEvent: any; + export class Animator { + static configureDefault(container: any, animatorInstance: any): any; + move(): any; + + /** + * Execute an 'enter' animation on an element + * + * @param element {HTMLElement} Element to animate + * + * @returns {Promise} Resolved when the animation is done + */ + enter(element: any): any; + + /** + * Execute a 'leave' animation on an element + * + * @param element {HTMLElement} Element to animate + * + * @returns {Promise} Resolved when the animation is done + */ + leave(element: any): any; + + /** + * Add a class to an element to trigger an animation. + * + * @param element {HTMLElement} Element to animate + * @param className {String} Properties to animate or name of the effect to use + * + * @returns {Promise} Resolved when the animation is done + */ + removeClass(element: any, className: any): any; + + /** + * Add a class to an element to trigger an animation. + * + * @param element {HTMLElement} Element to animate + * @param className {String} Properties to animate or name of the effect to use + * + * @returns {Promise} Resolved when the animation is done + */ + addClass(element: any, className: any): any; + + /** + * Execute a single animation. + * + * @param element {HTMLElement} Element to animate + * @param className {Object|String} Properties to animate or name of the effect to use + * For css animators this represents the className to + * be added and removed right after the animation is done + * @param options {Object} options for the animation (duration, easing, ...) + * + * @returns {Promise} Resolved when the animation is done + */ + animate(element: any, className: any, options: any): any; + + /** + * Run a sequence of animations one after the other. + * for example : animator.runSequence("fadeIn","callout") + * + * @param sequence {Array} An array of effectNames or classNames + * + * @returns {Promise} Resolved when all animations are done + */ + runSequence(sequence: any): any; + + /** + * Register an effect (for JS based animators) + * + * @param effectName {String} name identifier of the effect + * @param properties {Object} Object with properties for the effect + * + */ + registerEffect(effectName: any, properties: any): any; + + /** + * Unregister an effect (for JS based animators) + * + * @param effectName {String} name identifier of the effect + */ + unregisterEffect(effectName: any): any; + } + export function hyphenate(name: any): any; + export function nextElementSibling(element: any): any; + export class ViewStrategy { + static metadataKey: string; + makeRelativeTo(baseUrl: string): any; + static normalize(value: string | ViewStrategy): any; + static getDefault(target: any): ViewStrategy; + } + export class UseViewStrategy extends ViewStrategy { + constructor(path: string); + loadViewFactory(viewEngine: ViewEngine, options: Object, loadContext?: string[]): Promise; + makeRelativeTo(file: string): any; + } + export class ConventionalViewStrategy extends ViewStrategy { + constructor(moduleId: string); + loadViewFactory(viewEngine: ViewEngine, options: Object, loadContext?: string[]): Promise; + static convertModuleIdToViewUrl(moduleId: string): string; + } + export class NoViewStrategy extends ViewStrategy { + loadViewFactory(viewEngine: ViewEngine, options: Object, loadContext?: string[]): Promise; + } + export class TemplateRegistryViewStrategy extends ViewStrategy { + constructor(moduleId: string, entry: TemplateRegistryEntry); + loadViewFactory(viewEngine: ViewEngine, options: Object, loadContext?: string[]): Promise; + } + export class InlineViewStrategy extends ViewStrategy { + constructor(markup: string, dependencies?: Array, dependencyBaseUrl?: string); + loadViewFactory(viewEngine: ViewEngine, options: Object, loadContext?: string[]): Promise; + } + export class BindingLanguage { + inspectAttribute(resources: any, attrName: any, attrValue: any): any; + createAttributeInstruction(resources: any, element: any, info: any, existingInstruction: any): any; + parseText(resources: any, value: any): any; + } + export class ResourceRegistry { + constructor(); + registerElement(tagName: any, behavior: any): any; + getElement(tagName: any): any; + registerAttribute(attribute: any, behavior: any, knownAttribute: any): any; + getAttribute(attribute: any): any; + registerValueConverter(name: any, valueConverter: any): any; + getValueConverter(name: any): any; + } + export class ViewResources extends ResourceRegistry { + constructor(parent: any, viewUrl: any); + relativeToView(path: any): any; + getElement(tagName: any): any; + mapAttribute(attribute: any): any; + getAttribute(attribute: any): any; + getValueConverter(name: any): any; + } + + // NOTE: Adding a fragment to the document causes the nodes to be removed from the fragment. + // NOTE: Adding to the fragment, causes the nodes to be removed from the document. + export class View { + constructor(container: any, fragment: any, behaviors: any, bindings: any, children: any, systemControlled: any, contentSelectors: any); + created(executionContext: any): any; + bind(executionContext: any, systemUpdate: any): any; + addBinding(binding: any): any; + unbind(): any; + insertNodesBefore(refNode: any): any; + appendNodesTo(parent: any): any; + removeNodes(): any; + attached(): any; + detached(): any; + } + export class ContentSelector { + static applySelectors(view: any, contentSelectors: any, callback: any): any; + constructor(anchor: any, selector: any); + copyForViewSlot(): any; + matches(node: any): any; + add(group: any): any; + insert(index: any, group: any): any; + removeAt(index: any, fragment: any): any; + } + export class ViewSlot { + constructor(anchor: any, anchorIsContainer: any, executionContext: any, animator?: any); + transformChildNodesIntoView(): any; + bind(executionContext: any): any; + unbind(): any; + add(view: any): any; + insert(index: any, view: any): any; + remove(view: any): any; + removeAt(index: any): any; + removeAll(): any; + swap(view: any): any; + attached(): any; + detached(): any; + installContentSelectors(contentSelectors: any): any; + contentSelectorAdd(view: any): any; + contentSelectorInsert(index: any, view: any): any; + contentSelectorRemove(view: any): any; + contentSelectorRemoveAt(index: any): any; + contentSelectorRemoveAll(): any; + } + export class BoundViewFactory { + constructor(parentContainer: any, viewFactory: any, executionContext: any, partReplacements: any); + create(executionContext: any): any; + } + export class ViewFactory { + constructor(template: any, instructions: any, resources: any); + create(container: any, executionContext: any, options?: any, element?: any): any; + } + export class ViewCompiler { + static inject(): any; + constructor(bindingLanguage: any); + compile(templateOrFragment: any, resources: any, options?: any): any; + compileNode(node: any, resources: any, instructions: any, parentNode: any, parentInjectorId: any, targetLightDOM: any): any; + compileSurrogate(node: any, resources: any): any; + compileElement(node: any, resources: any, instructions: any, parentNode: any, parentInjectorId: any, targetLightDOM: any): any; + } + class ProxyViewFactory { + constructor(promise: any); + absorb(factory: any): any; + } + export class ViewEngine { + static inject(): any; + constructor(loader: Loader, container: Container, viewCompiler: ViewCompiler, moduleAnalyzer: ModuleAnalyzer, appResources: ResourceRegistry); + enhance(container: any, element: any, resources: any, bindingContext: any): any; + loadViewFactory(urlOrRegistryEntry: string | TemplateRegistryEntry, compileOptions?: Object, associatedModuleId?: string, loadContext?: string[]): Promise; + loadTemplateResources(viewRegistryEntry: TemplateRegistryEntry, associatedModuleId?: string, loadContext?: string[]): Promise; + importViewModelResource(moduleImport: string, moduleMember: string): Promise; + importViewResources(moduleIds: string[], names: string[], resources: ResourceRegistry, associatedModuleId?: string, loadContext?: string[]): Promise; + } + export class BehaviorInstance { + constructor(behavior: any, executionContext: any, instruction: any); + static createForUnitTest(type: any, attributes: any, bindingContext: any): any; + created(context: any): any; + bind(context: any): any; + unbind(): any; + attached(): any; + detached(): any; + } + export class BindableProperty { + constructor(nameOrConfig: any); + registerWith(target: any, behavior: any, descriptor: any): any; + configureDescriptor(behavior: any, descriptor: any): any; + defineOn(target: any, behavior: any): any; + createObserver(executionContext: any): any; + initialize(executionContext: any, observerLookup: any, attributes: any, behaviorHandlesBind: any, boundProperties: any): any; + createDynamicProperty(executionContext: any, observerLookup: any, behaviorHandlesBind: any, name: any, attribute: any, boundProperties: any): any; + } + class BehaviorPropertyObserver { + constructor(taskQueue: any, obj: any, propertyName: any, selfSubscriber: any, initialValue: any); + getValue(): any; + setValue(newValue: any): any; + call(): any; + subscribe(callback: any): any; + } + export class HtmlBehaviorResource { + constructor(); + static convention(name: string, existing?: HtmlBehaviorResource): any; + addChildBinding(behavior: BindingExpression): any; + analyze(container: Container, target: Function): any; + load(container: Container, target: Function, viewStrategy?: ViewStrategy, transientView?: boolean, loadContext?: string[]): Promise; + register(registry: ResourceRegistry, name?: string): any; + compile(compiler: ViewCompiler, resources: ResourceRegistry, node: Node, instruction: Object, parentNode?: Node): Node; + create(container: Container, instruction?: Object, element?: Element, bindings?: Binding[]): BehaviorInstance; + ensurePropertiesDefined(instance: Object, lookup: Object): any; + } + export class ResourceModule { + constructor(moduleId: string); + analyze(container: Container): any; + register(registry: ResourceRegistry, name?: string): any; + load(container: Container, loadContext?: string[]): Promise; + } + export class ResourceDescription { + constructor(key: string, exportedValue: any, resourceTypeMeta: Object); + analyze(container: Container): any; + register(registry: ResourceRegistry, name?: string): any; + load(container: Container, loadContext?: string[]): Promise | void; + static get(resource: any, key?: string): ResourceDescription; + } + export class ModuleAnalyzer { + constructor(); + getAnalysis(moduleId: string): ResourceModule; + analyze(moduleId: string, moduleInstance: any, viewModelMember?: string): ResourceModule; + } + export class ChildObserver { + constructor(config: any); + create(target: any, behavior: any): any; + } + + // TODO: we really only want one child observer per element. Right now you can have many, via @sync. + // We need to enable a way to share the observer across all uses and direct matches to the correct source. + export class ChildObserverBinder { + constructor(selector: any, target: any, property: any, behavior: any, changeHandler: any); + bind(source: any): any; + unbind(): any; + onChange(mutations: any): any; + } + export class CompositionEngine { + static inject(): any; + constructor(viewEngine: any); + activate(instruction: any): any; + createBehaviorAndSwap(instruction: any): any; + createBehavior(instruction: any): any; + createViewModel(instruction: any): any; + compose(instruction: any): any; + } + export class ElementConfigResource { + load(container: any, target: any): any; + register(): any; + } + export function behavior(override: any): any; + export function customElement(name: any): any; + export function customAttribute(name: any, defaultBindingMode: any): any; + export function templateController(target: any): any; + export function bindable(nameOrConfigOrTarget?: any, key?: any, descriptor?: any): any; + export function dynamicOptions(target: any): any; + export function sync(selectorOrConfig: any): any; + export function useShadowDOM(target: any): any; + + // this is now deprecated in favor of the processContent decorator + export function skipContentProcessing(target: any): any; + export function processContent(processor: any): any; + export function containerless(target: any): any; + export function viewStrategy(strategy: any): any; + export function useView(path: any): any; + export function inlineView(markup: string, dependencies?: Array, dependencyBaseUrl?: string): any; + export function noView(target: any): any; + export function elementConfig(target: any): any; +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/aurelia/aurelia-validation.d.ts b/src/Jackett.Web/typings/aurelia/aurelia-validation.d.ts new file mode 100644 index 000000000..645f5274d --- /dev/null +++ b/src/Jackett.Web/typings/aurelia/aurelia-validation.d.ts @@ -0,0 +1,614 @@ +declare module 'aurelia-validation/validation/utilities' { + export class Utilities { + constructor(); + static getValue(val: any): any; + static isEmptyValue(val: any): boolean; + } + +} +declare module 'aurelia-validation/validation/validation-locale' { + export class ValidationLocale { + static Repository: any; + defaults: any; + currentLocale: any; + constructor(defaults: any, data: any); + getValueFor(identifier: any, category: any): any; + setting(settingIdentifier: any): any; + translate(translationIdentifier: any, newValue: any, threshold: any): any; + } + +} +declare module 'aurelia-validation/validation/validate-custom-attribute-view-strategy' { + export class ValidateCustomAttributeViewStrategyBase { + bindingPathAttributes: any; + constructor(); + getValidationProperty(validation: any, element: any): any; + prepareElement(validationProperty: any, element: any): void; + updateElement(validationProperty: any, element: any): void; + } + export class TWBootstrapViewStrategy extends ValidateCustomAttributeViewStrategyBase { + appendMessageToInput: any; + appendMessageToLabel: any; + helpBlockClass: any; + constructor(appendMessageToInput: any, appendMessageToLabel: any, helpBlockClass: any); + searchFormGroup(currentElement: any, currentDepth: any): any; + findLabels(formGroup: any, inputId: any): any[]; + findLabelsRecursively(currentElement: any, inputId: any, currentLabels: any, currentDepth: any): void; + appendMessageToElement(element: any, validationProperty: any): void; + appendUIVisuals(validationProperty: any, currentElement: any): void; + prepareElement(validationProperty: any, element: any): void; + updateElement(validationProperty: any, element: any): void; + } + export class ValidateCustomAttributeViewStrategy { + static TWBootstrapAppendToInput: any; + static TWBootstrapAppendToMessage: any; + } + +} +declare module 'aurelia-validation/validation/validation-config' { + export class ValidationConfigDefaults { + static _defaults: any; + static defaults: any; + } + export class ValidationConfig { + static uniqueListenerId: any; + innerConfig: any; + values: any; + changedHandlers: any; + constructor(innerConfig?: any); + getValue(identifier: any): any; + setValue(identifier: any, value: any): ValidationConfig; + onLocaleChanged(callback: any): any; + getDebounceTimeout(): any; + useDebounceTimeout(value: any): ValidationConfig; + getDependencies(): any; + computedFrom(dependencies: any): ValidationConfig; + useLocale(localeIdentifier: any): ValidationConfig; + locale(): any; + useViewStrategy(viewStrategy: any): ValidationConfig; + getViewStrategy(): any; + } + +} +declare module 'aurelia-validation/validation/validation-result' { + export class ValidationResult { + isValid: any; + properties: any; + constructor(); + addProperty(name: any): any; + checkValidity(): void; + clear(): void; + } + export class ValidationResultProperty { + group: any; + onValidateCallbacks: any; + isValid: any; + isDirty: any; + message: any; + failingRule: any; + latestValue: any; + constructor(group: any); + clear(): void; + onValidate(onValidateCallback: any): void; + notifyObserversOfChange(): void; + setValidity(validationResponse: any, shouldBeDirty: any): void; + } + +} +declare module 'aurelia-validation/validation/validation-rules' { + export class ValidationRule { + onValidate: any; + threshold: any; + message: any; + errorMessage: any; + ruleName: any; + constructor(threshold: any, onValidate: any, message?: any); + withMessage(message: any): void; + explain(): any; + setResult(result: any, currentValue: any, locale: any): boolean; + /** + * Validation rules: return a promise that fulfills and resolves to true/false + */ + validate(currentValue: any, locale: any): Promise; + } + export class EmailValidationRule extends ValidationRule { + isFQDN: any; + emailUserUtf8Regex: any; + constructor(); + } + export class MinimumLengthValidationRule extends ValidationRule { + constructor(minimumLength: any); + } + export class MaximumLengthValidationRule extends ValidationRule { + constructor(maximumLength: any); + } + export class BetweenLengthValidationRule extends ValidationRule { + constructor(minimumLength: any, maximumLength: any); + } + export class CustomFunctionValidationRule extends ValidationRule { + constructor(customFunction: any, threshold: any); + } + export class NumericValidationRule extends ValidationRule { + constructor(); + } + export class RegexValidationRule extends ValidationRule { + constructor(regex: any); + } + export class ContainsOnlyValidationRule extends RegexValidationRule { + constructor(regex: any); + } + export class MinimumValueValidationRule extends ValidationRule { + constructor(minimumValue: any); + } + export class MinimumInclusiveValueValidationRule extends ValidationRule { + constructor(minimumValue: any); + } + export class MaximumValueValidationRule extends ValidationRule { + constructor(maximumValue: any); + } + export class MaximumInclusiveValueValidationRule extends ValidationRule { + constructor(maximumValue: any); + } + export class BetweenValueValidationRule extends ValidationRule { + constructor(minimumValue: any, maximumValue: any); + } + export class DigitValidationRule extends ValidationRule { + digitRegex: any; + constructor(); + } + export class AlphaNumericValidationRule extends ValidationRule { + alphaNumericRegex: any; + constructor(); + } + export class AlphaValidationRule extends ValidationRule { + alphaRegex: any; + constructor(); + } + export class AlphaOrWhitespaceValidationRule extends ValidationRule { + alphaNumericRegex: any; + constructor(); + } + export class AlphaNumericOrWhitespaceValidationRule extends ValidationRule { + alphaNumericRegex: any; + constructor(); + } + export class MediumPasswordValidationRule extends ValidationRule { + constructor(minimumComplexityLevel: any); + } + export class StrongPasswordValidationRule extends MediumPasswordValidationRule { + constructor(); + } + export class EqualityValidationRuleBase extends ValidationRule { + constructor(otherValue: any, equality: any, otherValueLabel?: any); + } + export class EqualityValidationRule extends EqualityValidationRuleBase { + constructor(otherValue: any); + } + export class EqualityWithOtherLabelValidationRule extends EqualityValidationRuleBase { + constructor(otherValue: any, otherLabel: any); + } + export class InEqualityValidationRule extends EqualityValidationRuleBase { + constructor(otherValue: any); + } + export class InEqualityWithOtherLabelValidationRule extends EqualityValidationRuleBase { + constructor(otherValue: any, otherLabel: any); + } + export class InCollectionValidationRule extends ValidationRule { + constructor(collection: any); + } + +} +declare module 'aurelia-validation/validation/validation-rules-collection' { + export class ValidationRulesCollection { + isRequired: any; + validationRules: any; + validationCollections: any; + isRequiredMessage: any; + constructor(); + /** + * Returns a promise that fulfils and resolves to simple result status object. + */ + validate(newValue: any, locale: any): Promise<{ + isValid: boolean; + message: any; + failingRule: string; + latestValue: any; + }>; + addValidationRule(validationRule: any): void; + addValidationRuleCollection(validationRulesCollection: any): void; + isNotEmpty(): void; + withMessage(message: any): void; + } + export class SwitchCaseValidationRulesCollection { + conditionExpression: any; + innerCollections: any; + defaultCollection: any; + caseLabel: any; + defaultCaseLabel: any; + constructor(conditionExpression: any); + case(caseLabel: any): void; + default(): void; + getCurrentCollection(caseLabel: any, createIfNotExists?: boolean): any; + validate(newValue: any, locale: any): any; + addValidationRule(validationRule: any): void; + addValidationRuleCollection(validationRulesCollection: any): void; + isNotEmpty(): void; + withMessage(message: any): void; + } + +} +declare module 'aurelia-validation/validation/path-observer' { + export class PathObserver { + observerLocator: any; + path: any; + subject: any; + observers: any; + callbacks: any; + constructor(observerLocator: any, subject: any, path: any); + observeParts(propertyName?: any): void; + observePart(part: any): void; + getObserver(): any; + getValue(): any; + subscribe(callback: any): any; + } + +} +declare module 'aurelia-validation/validation/debouncer' { + export class Debouncer { + currentFunction: any; + debounceTimeout: any; + constructor(debounceTimeout: any); + debounce(func: any): void; + } + +} +declare module 'aurelia-validation/validation/validation-property' { + export class ValidationProperty { + propertyResult: any; + propertyName: any; + validationGroup: any; + collectionOfValidationRules: any; + config: any; + latestValue: any; + observer: any; + debouncer: any; + dependencyObservers: any; + constructor(observerLocator: any, propertyName: any, validationGroup: any, propertyResult: any, config: any); + addValidationRule(validationRule: any): void; + validateCurrentValue(forceDirty: any, forceExecution?: any): any; + clear(): void; + /** + * returns a promise that fulfils and resolves to true/false + */ + validate(newValue: any, shouldBeDirty: any, forceExecution?: any): any; + } + +} +declare module 'aurelia-validation/validation/validation-group-builder' { + export class ValidationGroupBuilder { + observerLocator: any; + validationRuleCollections: any; + validationGroup: any; + constructor(observerLocator: any, validationGroup: any); + ensure(propertyName: any, configurationCallback: any): any; + isNotEmpty(): any; + isGreaterThan(minimumValue: any): any; + isGreaterThanOrEqualTo(minimumValue: any): any; + isBetween(minimumValue: any, maximumValue: any): any; + isIn(collection: any): any; + isLessThan(maximumValue: any): any; + isLessThanOrEqualTo(maximumValue: any): any; + isEqualTo(otherValue: any, otherValueLabel: any): any; + isNotEqualTo(otherValue: any, otherValueLabel: any): any; + isEmail(): any; + hasMinLength(minimumValue: any): any; + hasMaxLength(maximumValue: any): any; + hasLengthBetween(minimumValue: any, maximumValue: any): any; + isNumber(): any; + containsOnlyDigits(): any; + containsOnlyAlpha(): any; + containsOnlyAlphaOrWhitespace(): any; + containsOnlyAlphanumerics(): any; + containsOnlyAlphanumericsOrWhitespace(): any; + isStrongPassword(minimumComplexityLevel: any): any; + containsOnly(regex: any): any; + matches(regex: any): any; + passes(customFunction: any, threshold: any): any; + passesRule(validationRule: any): any; + checkLast(): void; + withMessage(message: any): any; + if(conditionExpression: any): any; + else(): any; + endIf(): any; + switch(conditionExpression: any): any; + case(caseLabel: any): any; + default(): any; + endSwitch(): any; + } + +} +declare module 'aurelia-validation/validation/validation-group' { + /** + * Encapsulates validation rules and their current validation state for a given subject + * @class ValidationGroup + * @constructor + */ + export class ValidationGroup { + result: any; + subject: any; + validationProperties: any; + config: any; + builder: any; + onValidateCallbacks: any; + onPropertyValidationCallbacks: any; + isValidating: any; + onDestroy: any; + /** + * Instantiates a new {ValidationGroup} + * @param subject The subject to evaluate + * @param observerLocator The observerLocator used to monitor changes on the subject + * @param config The configuration + */ + constructor(subject: any, observerLocator: any, config: any); + destroy(): void; + clear(): void; + onBreezeEntity(): void; + /** + * Causes complete re-evaluation: gets the latest value, marks the property as 'dirty' (unless false is passed), runs validation rules asynchronously and updates this.result + * @returns {Promise} A promise that fulfils when valid, rejects when invalid. + */ + validate(forceDirty?: boolean, forceExecution?: boolean): Promise; + onValidate(validationFunction: any, validationFunctionFailedCallback?: any): ValidationGroup; + onPropertyValidate(validationFunction: any): ValidationGroup; + /** + * Adds a validation property for the specified path + * @param {String} bindingPath the path of the property/field, for example 'firstName' or 'address.muncipality.zipCode' + * @param configCallback a configuration callback + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + ensure(bindingPath: any, configCallback?: any): ValidationGroup; + /** + * Adds a validation rule that checks a value for being 'isNotEmpty', 'required' + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + isNotEmpty(): any; + /** + * Adds a validation rule that checks a value for being greater than or equal to a threshold + * @param minimumValue the threshold + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + isGreaterThanOrEqualTo(minimumValue: any): any; + /** + * Adds a validation rule that checks a value for being greater than a threshold + * @param minimumValue the threshold + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + isGreaterThan(minimumValue: any): any; + /** + * Adds a validation rule that checks a value for being greater than or equal to a threshold, and less than or equal to another threshold + * @param minimumValue The minimum threshold + * @param maximumValue The isLessThanOrEqualTo threshold + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + isBetween(minimumValue: any, maximumValue: any): any; + /** + * Adds a validation rule that checks a value for being less than a threshold + * @param maximumValue The threshold + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + isLessThanOrEqualTo(maximumValue: any): any; + /** + * Adds a validation rule that checks a value for being less than or equal to a threshold + * @param maximumValue The threshold + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + isLessThan(maximumValue: any): any; + /** + * Adds a validation rule that checks a value for being equal to a threshold + * @param otherValue The threshold + * @param otherValueLabel Optional: a label to use in the validation message + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + isEqualTo(otherValue: any, otherValueLabel: any): any; + /** + * Adds a validation rule that checks a value for not being equal to a threshold + * @param otherValue The threshold + * @param otherValueLabel Optional: a label to use in the validation message + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + isNotEqualTo(otherValue: any, otherValueLabel: any): any; + /** + * Adds a validation rule that checks a value for being a valid isEmail address + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + isEmail(): any; + /** + * Adds a validation rule that checks a value for being equal to at least one other value in a particular collection + * @param collection The threshold + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + isIn(collection: any): any; + /** + * Adds a validation rule that checks a value for having a length greater than or equal to a specified threshold + * @param minimumValue The threshold + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + hasMinLength(minimumValue: any): any; + /** + * Adds a validation rule that checks a value for having a length less than a specified threshold + * @param maximumValue The threshold + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + hasMaxLength(maximumValue: any): any; + /** + * Adds a validation rule that checks a value for having a length greater than or equal to a specified threshold and less than another threshold + * @param minimumValue The min threshold + * @param maximumValue The max threshold + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + hasLengthBetween(minimumValue: any, maximumValue: any): any; + /** + * Adds a validation rule that checks a value for being numeric, this includes formatted numbers like '-3,600.25' + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + isNumber(): any; + /** + * Adds a validation rule that checks a value for being strictly numeric, this excludes formatted numbers like '-3,600.25' + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + containsOnlyDigits(): any; + containsOnly(regex: any): any; + containsOnlyAlpha(): any; + containsOnlyAlphaOrWhitespace(): any; + containsOnlyLetters(): any; + containsOnlyLettersOrWhitespace(): any; + /** + * Adds a validation rule that checks a value for only containing alphanumerical characters + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + containsOnlyAlphanumerics(): any; + /** + * Adds a validation rule that checks a value for only containing alphanumerical characters or whitespace + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + containsOnlyAlphanumericsOrWhitespace(): any; + /** + * Adds a validation rule that checks a value for being a strong password. A strong password contains at least the specified of the following groups: lowercase characters, uppercase characters, digits and special characters. + * @param minimumComplexityLevel {Number} Optionally, specifiy the number of groups to match. Default is 4. + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + isStrongPassword(minimumComplexityLevel: any): any; + /** + * Adds a validation rule that checks a value for matching a particular regex + * @param regex the regex to match + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + matches(regex: any): any; + /** + * Adds a validation rule that checks a value for passing a custom function + * @param customFunction {Function} The custom function that needs to pass, that takes two arguments: newValue (the value currently being evaluated) and optionally: threshold, and returns true/false. + * @param threshold {Object} An optional threshold that will be passed to the customFunction + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + passes(customFunction: any, threshold?: any): any; + /** + * Adds the {ValidationRule} + * @param validationRule {ValudationRule} The rule that needs to pass + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + passesRule(validationRule: any): any; + /** + * Specifies that the next validation rules only need to be evaluated when the specified conditionExpression is true + * @param conditionExpression {Function} a function that returns true of false. + * @param threshold {Object} an optional treshold object that is passed to the conditionExpression + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + if(conditionExpression: any, threshold: any): any; + /** + * Specifies that the next validation rules only need to be evaluated when the previously specified conditionExpression is false. + * See: if(conditionExpression, threshold) + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + else(): any; + /** + * Specifies that the execution of next validation rules no longer depend on the the previously specified conditionExpression. + * See: if(conditionExpression, threshold) + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + endIf(): any; + /** + * Specifies that the next validation rules only need to be evaluated when they are preceded by a case that matches the conditionExpression + * @param conditionExpression {Function} a function that returns a case label to execute. This is optional, when omitted the case label will be matched using the underlying property's value + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + switch(conditionExpression: any): any; + /** + * Specifies that the next validation rules only need to be evaluated when the caseLabel matches the value returned by a preceding switch statement + * See: switch(conditionExpression) + * @param caseLabel {Object} the case label + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + case(caseLabel: any): any; + /** + * Specifies that the next validation rules only need to be evaluated when not other caseLabel matches the value returned by a preceding switch statement + * See: switch(conditionExpression) + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + default(): any; + /** + * Specifies that the execution of next validation rules no longer depend on the the previously specified conditionExpression. + * See: switch(conditionExpression) + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + endSwitch(): any; + /** + * Specifies that the execution of the previous validation rule should use the specified error message if it fails + * @param message either a static string or a function that takes two arguments: newValue (the value that has been evaluated) and threshold. + * @returns {ValidationGroup} returns this ValidationGroup, to enable fluent API + */ + withMessage(message: any): any; + } + +} +declare module 'aurelia-validation/validation/validation' { + import { ValidationGroup } from 'aurelia-validation/validation/validation-group'; + /** + * A lightweight validation plugin + * @class Validation + * @constructor + */ + export class Validation { + static defaults: any; + observerLocator: any; + config: any; + /** + * Instantiates a new {Validation} + * @param observerLocator the observerLocator used to observer properties + * @param validationConfig the configuration + */ + constructor(observerLocator: any, validationConfig: any); + /** + * Returns a new validation group on the subject + * @param subject The subject to validate + * @returns {ValidationGroup} A ValidationGroup that encapsulates the validation rules and current validation state for this subject + */ + on(subject: any, configCallback: any): ValidationGroup; + onBreezeEntity(breezeEntity: any, configCallback: any): ValidationGroup; + } + +} +declare module 'aurelia-validation/validation/validate-custom-attribute' { + export class ValidateCustomAttribute { + element: any; + processedValidation: any; + viewStrategy: any; + value: any; + constructor(element: any); + valueChanged(newValue: any): void; + subscribeChangedHandlers(currentElement: any): void; + detached(): void; + attached(): void; + } + +} +declare module 'aurelia-validation/validation/decorators' { + export function ensure(setupStep: any): (target: any, propertyName: any) => void; + +} +declare module 'aurelia-validation/index' { + export { Utilities } from 'aurelia-validation/validation/utilities'; + export { ValidationConfig } from 'aurelia-validation/validation/validation-config'; + export { ValidationLocale } from 'aurelia-validation/validation/validation-locale'; + export * from 'aurelia-validation/validation/validation-result'; + export * from 'aurelia-validation/validation/validation-rules'; + export { Validation } from 'aurelia-validation/validation/validation'; + export { ValidateCustomAttribute } from 'aurelia-validation/validation/validate-custom-attribute'; + export { ValidateCustomAttributeViewStrategy } from 'aurelia-validation/validation/validate-custom-attribute-view-strategy'; + export { ValidateCustomAttributeViewStrategyBase } from 'aurelia-validation/validation/validate-custom-attribute-view-strategy'; + export { ensure } from 'aurelia-validation/validation/decorators'; + export function configure(aurelia: any, configCallback: any): any; + +} +declare module 'aurelia-validation' { + export * from 'aurelia-validation/index'; +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/core-js.d.ts b/src/Jackett.Web/typings/core-js.d.ts new file mode 100644 index 000000000..dcc44705d --- /dev/null +++ b/src/Jackett.Web/typings/core-js.d.ts @@ -0,0 +1,4 @@ +declare module 'core-js' { + var core:any; + export default core +} diff --git a/src/Jackett.Web/typings/es6.d.ts b/src/Jackett.Web/typings/es6.d.ts new file mode 100644 index 000000000..8574e2fd7 --- /dev/null +++ b/src/Jackett.Web/typings/es6.d.ts @@ -0,0 +1,18293 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +/// + +///////////////////////////// +/// ECMAScript APIs +///////////////////////////// + +declare var NaN: number; +declare var Infinity: number; + +/** + * Evaluates JavaScript code and executes it. + * @param x A String value that contains valid JavaScript code. + */ +declare function eval(x: string): any; + +/** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ +declare function parseInt(s: string, radix?: number): number; + +/** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ +declare function parseFloat(string: string): number; + +/** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). + * @param number A numeric value. + */ +declare function isNaN(number: number): boolean; + +/** + * Determines whether a supplied number is finite. + * @param number Any numeric value. + */ +declare function isFinite(number: number): boolean; + +/** + * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). + * @param encodedURI A value representing an encoded URI. + */ +declare function decodeURI(encodedURI: string): string; + +/** + * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). + * @param encodedURIComponent A value representing an encoded URI component. + */ +declare function decodeURIComponent(encodedURIComponent: string): string; + +/** + * Encodes a text string as a valid Uniform Resource Identifier (URI) + * @param uri A value representing an encoded URI. + */ +declare function encodeURI(uri: string): string; + +/** + * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). + * @param uriComponent A value representing an encoded URI component. + */ +declare function encodeURIComponent(uriComponent: string): string; + +interface PropertyDescriptor { + configurable?: boolean; + enumerable?: boolean; + value?: any; + writable?: boolean; + get? (): any; + set? (v: any): void; +} + +interface PropertyDescriptorMap { + [s: string]: PropertyDescriptor; +} + +interface Object { + /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ + constructor: Function; + + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns a date converted to a string using the current locale. */ + toLocaleString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): Object; + + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: string): boolean; + + /** + * Determines whether an object exists in another object's prototype chain. + * @param v Another object whose prototype chain is to be checked. + */ + isPrototypeOf(v: Object): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: string): boolean; +} + +interface ObjectConstructor { + new (value?: any): Object; + (): any; + (value: any): any; + + /** A reference to the prototype for a class of objects. */ + prototype: Object; + + /** + * Returns the prototype of an object. + * @param o The object that references the prototype. + */ + getPrototypeOf(o: any): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; + + /** + * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly + * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. + * @param o Object that contains the own properties. + */ + getOwnPropertyNames(o: any): string[]; + + /** + * Creates an object that has the specified prototype, and that optionally contains specified properties. + * @param o Object to use as a prototype. May be null + * @param properties JavaScript object that contains one or more property descriptors. + */ + create(o: any, properties?: PropertyDescriptorMap): any; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor property. + */ + defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; + + /** + * Adds one or more properties to an object, and/or modifies attributes of existing properties. + * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. + * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. + */ + defineProperties(o: any, properties: PropertyDescriptorMap): any; + + /** + * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + seal(o: T): T; + + /** + * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. + * @param o Object on which to lock the attributes. + */ + freeze(o: T): T; + + /** + * Prevents the addition of new properties to an object. + * @param o Object to make non-extensible. + */ + preventExtensions(o: T): T; + + /** + * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. + * @param o Object to test. + */ + isSealed(o: any): boolean; + + /** + * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. + * @param o Object to test. + */ + isFrozen(o: any): boolean; + + /** + * Returns a value that indicates whether new properties can be added to an object. + * @param o Object to test. + */ + isExtensible(o: any): boolean; + + /** + * Returns the names of the enumerable properties and methods of an object. + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + keys(o: any): string[]; +} + +/** + * Provides functionality common to all JavaScript objects. + */ +declare var Object: ObjectConstructor; + +/** + * Creates a new function. + */ +interface Function { + /** + * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. + * @param thisArg The object to be used as the this object. + * @param argArray A set of arguments to be passed to the function. + */ + apply(thisArg: any, argArray?: any): any; + + /** + * Calls a method of an object, substituting another object for the current object. + * @param thisArg The object to be used as the current object. + * @param argArray A list of arguments to be passed to the method. + */ + call(thisArg: any, ...argArray: any[]): any; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg An object to which the this keyword can refer inside the new function. + * @param argArray A list of arguments to be passed to the new function. + */ + bind(thisArg: any, ...argArray: any[]): any; + + prototype: any; + length: number; + + // Non-standard extensions + arguments: any; + caller: Function; +} + +interface FunctionConstructor { + /** + * Creates a new function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): Function; + (...args: string[]): Function; + prototype: Function; +} + +declare var Function: FunctionConstructor; + +interface IArguments { + [index: number]: any; + length: number; + callee: Function; +} + +interface String { + /** Returns a string representation of a string. */ + toString(): string; + + /** + * Returns the character at the specified index. + * @param pos The zero-based index of the desired character. + */ + charAt(pos: number): string; + + /** + * Returns the Unicode value of the character at the specified location. + * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. + */ + charCodeAt(index: number): number; + + /** + * Returns a string that contains the concatenation of two or more strings. + * @param strings The strings to append to the end of the string. + */ + concat(...strings: string[]): string; + + /** + * Returns the position of the first occurrence of a substring. + * @param searchString The substring to search for in the string + * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. + */ + indexOf(searchString: string, position?: number): number; + + /** + * Returns the last occurrence of a substring in the string. + * @param searchString The substring to search for. + * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. + */ + lastIndexOf(searchString: string, position?: number): number; + + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + */ + localeCompare(that: string): number; + + /** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * @param regexp A variable name or string literal containing the regular expression pattern and flags. + */ + match(regexp: string): RegExpMatchArray; + + /** + * Matches a string with a regular expression, and returns an array containing the results of that search. + * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. + */ + match(regexp: RegExp): RegExpMatchArray; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A String object or string literal that represents the regular expression + * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. + */ + replace(searchValue: string, replaceValue: string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A String object or string literal that represents the regular expression + * @param replaceValue A function that returns the replacement text. + */ + replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags + * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. + */ + replace(searchValue: RegExp, replaceValue: string): string; + + /** + * Replaces text in a string, using a regular expression or search string. + * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags + * @param replaceValue A function that returns the replacement text. + */ + replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; + + /** + * Finds the first substring match in a regular expression search. + * @param regexp The regular expression pattern and applicable flags. + */ + search(regexp: string): number; + + /** + * Finds the first substring match in a regular expression search. + * @param regexp The regular expression pattern and applicable flags. + */ + search(regexp: RegExp): number; + + /** + * Returns a section of a string. + * @param start The index to the beginning of the specified portion of stringObj. + * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. + * If this value is not specified, the substring continues to the end of stringObj. + */ + slice(start?: number, end?: number): string; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(separator: string, limit?: number): string[]; + + /** + * Split a string into substrings using the specified separator and return them as an array. + * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. + * @param limit A value used to limit the number of elements returned in the array. + */ + split(separator: RegExp, limit?: number): string[]; + + /** + * Returns the substring at the specified location within a String object. + * @param start The zero-based index number indicating the beginning of the substring. + * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. + * If end is omitted, the characters from start through the end of the original string are returned. + */ + substring(start: number, end?: number): string; + + /** Converts all the alphabetic characters in a string to lowercase. */ + toLowerCase(): string; + + /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ + toLocaleLowerCase(): string; + + /** Converts all the alphabetic characters in a string to uppercase. */ + toUpperCase(): string; + + /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ + toLocaleUpperCase(): string; + + /** Removes the leading and trailing white space and line terminator characters from a string. */ + trim(): string; + + /** Returns the length of a String object. */ + length: number; + + // IE extensions + /** + * Gets a substring beginning at the specified location and having the specified length. + * @param from The starting position of the desired substring. The index of the first character in the string is zero. + * @param length The number of characters to include in the returned substring. + */ + substr(from: number, length?: number): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): string; + + [index: number]: string; +} + +interface StringConstructor { + new (value?: any): String; + (value?: any): string; + prototype: String; + fromCharCode(...codes: number[]): string; +} + +/** + * Allows manipulation and formatting of text strings and determination and location of substrings within strings. + */ +declare var String: StringConstructor; + +interface Boolean { + /** Returns the primitive value of the specified object. */ + valueOf(): boolean; +} + +interface BooleanConstructor { + new (value?: any): Boolean; + (value?: any): boolean; + prototype: Boolean; +} + +declare var Boolean: BooleanConstructor; + +interface Number { + /** + * Returns a string representation of an object. + * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. + */ + toString(radix?: number): string; + + /** + * Returns a string representing a number in fixed-point notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toFixed(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented in exponential notation. + * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. + */ + toExponential(fractionDigits?: number): string; + + /** + * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. + * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. + */ + toPrecision(precision?: number): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): number; +} + +interface NumberConstructor { + new (value?: any): Number; + (value?: any): number; + prototype: Number; + + /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ + MAX_VALUE: number; + + /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ + MIN_VALUE: number; + + /** + * A value that is not a number. + * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. + */ + NaN: number; + + /** + * A value that is less than the largest negative number that can be represented in JavaScript. + * JavaScript displays NEGATIVE_INFINITY values as -infinity. + */ + NEGATIVE_INFINITY: number; + + /** + * A value greater than the largest number that can be represented in JavaScript. + * JavaScript displays POSITIVE_INFINITY values as infinity. + */ + POSITIVE_INFINITY: number; +} + +/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ +declare var Number: NumberConstructor; + +interface TemplateStringsArray extends Array { + raw: string[]; +} + +interface Math { + /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ + E: number; + /** The natural logarithm of 10. */ + LN10: number; + /** The natural logarithm of 2. */ + LN2: number; + /** The base-2 logarithm of e. */ + LOG2E: number; + /** The base-10 logarithm of e. */ + LOG10E: number; + /** Pi. This is the ratio of the circumference of a circle to its diameter. */ + PI: number; + /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ + SQRT1_2: number; + /** The square root of 2. */ + SQRT2: number; + /** + * Returns the absolute value of a number (the value without regard to whether it is positive or negative). + * For example, the absolute value of -5 is the same as the absolute value of 5. + * @param x A numeric expression for which the absolute value is needed. + */ + abs(x: number): number; + /** + * Returns the arc cosine (or inverse cosine) of a number. + * @param x A numeric expression. + */ + acos(x: number): number; + /** + * Returns the arcsine of a number. + * @param x A numeric expression. + */ + asin(x: number): number; + /** + * Returns the arctangent of a number. + * @param x A numeric expression for which the arctangent is needed. + */ + atan(x: number): number; + /** + * Returns the angle (in radians) from the X axis to a point. + * @param y A numeric expression representing the cartesian y-coordinate. + * @param x A numeric expression representing the cartesian x-coordinate. + */ + atan2(y: number, x: number): number; + /** + * Returns the smallest number greater than or equal to its numeric argument. + * @param x A numeric expression. + */ + ceil(x: number): number; + /** + * Returns the cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cos(x: number): number; + /** + * Returns e (the base of natural logarithms) raised to a power. + * @param x A numeric expression representing the power of e. + */ + exp(x: number): number; + /** + * Returns the greatest number less than or equal to its numeric argument. + * @param x A numeric expression. + */ + floor(x: number): number; + /** + * Returns the natural logarithm (base e) of a number. + * @param x A numeric expression. + */ + log(x: number): number; + /** + * Returns the larger of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + max(...values: number[]): number; + /** + * Returns the smaller of a set of supplied numeric expressions. + * @param values Numeric expressions to be evaluated. + */ + min(...values: number[]): number; + /** + * Returns the value of a base expression taken to a specified power. + * @param x The base value of the expression. + * @param y The exponent value of the expression. + */ + pow(x: number, y: number): number; + /** Returns a pseudorandom number between 0 and 1. */ + random(): number; + /** + * Returns a supplied numeric expression rounded to the nearest number. + * @param x The value to be rounded to the nearest number. + */ + round(x: number): number; + /** + * Returns the sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sin(x: number): number; + /** + * Returns the square root of a number. + * @param x A numeric expression. + */ + sqrt(x: number): number; + /** + * Returns the tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tan(x: number): number; +} +/** An intrinsic object that provides basic mathematics functionality and constants. */ +declare var Math: Math; + +/** Enables basic storage and retrieval of dates and times. */ +interface Date { + /** Returns a string representation of a date. The format of the string depends on the locale. */ + toString(): string; + /** Returns a date as a string value. */ + toDateString(): string; + /** Returns a time as a string value. */ + toTimeString(): string; + /** Returns a value as a string value appropriate to the host environment's current locale. */ + toLocaleString(): string; + /** Returns a date as a string value appropriate to the host environment's current locale. */ + toLocaleDateString(): string; + /** Returns a time as a string value appropriate to the host environment's current locale. */ + toLocaleTimeString(): string; + /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ + valueOf(): number; + /** Gets the time value in milliseconds. */ + getTime(): number; + /** Gets the year, using local time. */ + getFullYear(): number; + /** Gets the year using Universal Coordinated Time (UTC). */ + getUTCFullYear(): number; + /** Gets the month, using local time. */ + getMonth(): number; + /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ + getUTCMonth(): number; + /** Gets the day-of-the-month, using local time. */ + getDate(): number; + /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ + getUTCDate(): number; + /** Gets the day of the week, using local time. */ + getDay(): number; + /** Gets the day of the week using Universal Coordinated Time (UTC). */ + getUTCDay(): number; + /** Gets the hours in a date, using local time. */ + getHours(): number; + /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ + getUTCHours(): number; + /** Gets the minutes of a Date object, using local time. */ + getMinutes(): number; + /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ + getUTCMinutes(): number; + /** Gets the seconds of a Date object, using local time. */ + getSeconds(): number; + /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCSeconds(): number; + /** Gets the milliseconds of a Date, using local time. */ + getMilliseconds(): number; + /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ + getUTCMilliseconds(): number; + /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ + getTimezoneOffset(): number; + /** + * Sets the date and time value in the Date object. + * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. + */ + setTime(time: number): number; + /** + * Sets the milliseconds value in the Date object using local time. + * @param ms A numeric value equal to the millisecond value. + */ + setMilliseconds(ms: number): number; + /** + * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). + * @param ms A numeric value equal to the millisecond value. + */ + setUTCMilliseconds(ms: number): number; + + /** + * Sets the seconds value in the Date object using local time. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setSeconds(sec: number, ms?: number): number; + /** + * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCSeconds(sec: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using local time. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCMinutes(min: number, sec?: number, ms?: number): number; + /** + * Sets the hour value in the Date object using local time. + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the hours value in the Date object using Universal Coordinated Time (UTC). + * @param hours A numeric value equal to the hours value. + * @param min A numeric value equal to the minutes value. + * @param sec A numeric value equal to the seconds value. + * @param ms A numeric value equal to the milliseconds value. + */ + setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; + /** + * Sets the numeric day-of-the-month value of the Date object using local time. + * @param date A numeric value equal to the day of the month. + */ + setDate(date: number): number; + /** + * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). + * @param date A numeric value equal to the day of the month. + */ + setUTCDate(date: number): number; + /** + * Sets the month value in the Date object using local time. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. + */ + setMonth(month: number, date?: number): number; + /** + * Sets the month value in the Date object using Universal Coordinated Time (UTC). + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. + * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. + */ + setUTCMonth(month: number, date?: number): number; + /** + * Sets the year of the Date object using local time. + * @param year A numeric value for the year. + * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. + * @param date A numeric value equal for the day of the month. + */ + setFullYear(year: number, month?: number, date?: number): number; + /** + * Sets the year value in the Date object using Universal Coordinated Time (UTC). + * @param year A numeric value equal to the year. + * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. + * @param date A numeric value equal to the day of the month. + */ + setUTCFullYear(year: number, month?: number, date?: number): number; + /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ + toUTCString(): string; + /** Returns a date as a string value in ISO format. */ + toISOString(): string; + /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ + toJSON(key?: any): string; +} + +interface DateConstructor { + new (): Date; + new (value: number): Date; + new (value: string): Date; + new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; + (): string; + prototype: Date; + /** + * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. + * @param s A date string + */ + parse(s: string): number; + /** + * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. + * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. + * @param month The month as an number between 0 and 11 (January to December). + * @param date The date as an number between 1 and 31. + * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. + * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. + * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. + * @param ms An number from 0 to 999 that specifies the milliseconds. + */ + UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; + now(): number; +} + +declare var Date: DateConstructor; + +interface RegExpMatchArray extends Array { + index?: number; + input?: string; +} + +interface RegExpExecArray extends Array { + index: number; + input: string; +} + +interface RegExp { + /** + * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. + * @param string The String object or string literal on which to perform the search. + */ + exec(string: string): RegExpExecArray; + + /** + * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. + * @param string String on which to perform the search. + */ + test(string: string): boolean; + + /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */ + source: string; + + /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ + global: boolean; + + /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ + ignoreCase: boolean; + + /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ + multiline: boolean; + + lastIndex: number; + + // Non-standard extensions + compile(): RegExp; +} + +interface RegExpConstructor { + new (pattern: string, flags?: string): RegExp; + (pattern: string, flags?: string): RegExp; + prototype: RegExp; + + // Non-standard extensions + $1: string; + $2: string; + $3: string; + $4: string; + $5: string; + $6: string; + $7: string; + $8: string; + $9: string; + lastMatch: string; +} + +declare var RegExp: RegExpConstructor; + +interface Error { + name: string; + message: string; +} + +interface ErrorConstructor { + new (message?: string): Error; + (message?: string): Error; + prototype: Error; +} + +declare var Error: ErrorConstructor; + +interface EvalError extends Error { +} + +interface EvalErrorConstructor { + new (message?: string): EvalError; + (message?: string): EvalError; + prototype: EvalError; +} + +declare var EvalError: EvalErrorConstructor; + +interface RangeError extends Error { +} + +interface RangeErrorConstructor { + new (message?: string): RangeError; + (message?: string): RangeError; + prototype: RangeError; +} + +declare var RangeError: RangeErrorConstructor; + +interface ReferenceError extends Error { +} + +interface ReferenceErrorConstructor { + new (message?: string): ReferenceError; + (message?: string): ReferenceError; + prototype: ReferenceError; +} + +declare var ReferenceError: ReferenceErrorConstructor; + +interface SyntaxError extends Error { +} + +interface SyntaxErrorConstructor { + new (message?: string): SyntaxError; + (message?: string): SyntaxError; + prototype: SyntaxError; +} + +declare var SyntaxError: SyntaxErrorConstructor; + +interface TypeError extends Error { +} + +interface TypeErrorConstructor { + new (message?: string): TypeError; + (message?: string): TypeError; + prototype: TypeError; +} + +declare var TypeError: TypeErrorConstructor; + +interface URIError extends Error { +} + +interface URIErrorConstructor { + new (message?: string): URIError; + (message?: string): URIError; + prototype: URIError; +} + +declare var URIError: URIErrorConstructor; + +interface JSON { + /** + * Converts a JavaScript Object Notation (JSON) string into an object. + * @param text A valid JSON string. + * @param reviver A function that transforms the results. This function is called for each member of the object. + * If a member contains nested objects, the nested objects are transformed before the parent object is. + */ + parse(text: string, reviver?: (key: any, value: any) => any): any; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + */ + stringify(value: any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + */ + stringify(value: any, replacer: (key: string, value: any) => any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer Array that transforms the results. + */ + stringify(value: any, replacer: any[]): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer A function that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer: (key: string, value: any) => any, space: any): string; + /** + * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. + * @param value A JavaScript value, usually an object or array, to be converted. + * @param replacer Array that transforms the results. + * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. + */ + stringify(value: any, replacer: any[], space: any): string; +} +/** + * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. + */ +declare var JSON: JSON; + + +///////////////////////////// +/// ECMAScript Array API (specially handled by compiler) +///////////////////////////// + +interface Array { + /** + * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. + */ + length: number; + /** + * Returns a string representation of an array. + */ + toString(): string; + toLocaleString(): string; + /** + * Appends new elements to an array, and returns the new length of the array. + * @param items New elements of the Array. + */ + push(...items: T[]): number; + /** + * Removes the last element from an array and returns it. + */ + pop(): T; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: U[]): T[]; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(...items: T[]): T[]; + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + /** + * Reverses the elements in an Array. + */ + reverse(): T[]; + /** + * Removes the first element from an array and returns it. + */ + shift(): T; + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): T[]; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: T, b: T) => number): T[]; + + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + */ + splice(start: number): T[]; + + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + * @param deleteCount The number of elements to remove. + * @param items Elements to insert into the array in place of the deleted elements. + */ + splice(start: number, deleteCount: number, ...items: T[]): T[]; + + /** + * Inserts new elements at the start of an array. + * @param items Elements to insert at the start of the Array. + */ + unshift(...items: T[]): number; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + */ + indexOf(searchElement: T, fromIndex?: number): number; + + /** + * Returns the index of the last occurrence of a specified value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. + */ + lastIndexOf(searchElement: T, fromIndex?: number): number; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; + + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + [n: number]: T; +} + +interface ArrayConstructor { + new (arrayLength?: number): any[]; + new (arrayLength: number): T[]; + new (...items: T[]): T[]; + (arrayLength?: number): any[]; + (arrayLength: number): T[]; + (...items: T[]): T[]; + isArray(arg: any): boolean; + prototype: Array; +} + +declare var Array: ArrayConstructor; + +interface TypedPropertyDescriptor { + enumerable?: boolean; + configurable?: boolean; + writable?: boolean; + value?: T; + get?: () => T; + set?: (value: T) => void; +} + +declare type ClassDecorator = (target: TFunction) => TFunction | void; +declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void; +declare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void; +declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void; +declare type PropertyKey = string | number | symbol; + +interface Symbol { + /** Returns a string representation of an object. */ + toString(): string; + + /** Returns the primitive value of the specified object. */ + valueOf(): Object; + + [Symbol.toStringTag]: string; +} + +interface SymbolConstructor { + /** + * A reference to the prototype. + */ + prototype: Symbol; + + /** + * Returns a new unique Symbol value. + * @param description Description of the new Symbol object. + */ + (description?: string|number): symbol; + + /** + * Returns a Symbol object from the global symbol registry matching the given key if found. + * Otherwise, returns a new symbol with this key. + * @param key key to search for. + */ + for(key: string): symbol; + + /** + * Returns a key from the global symbol registry matching the given Symbol if found. + * Otherwise, returns a undefined. + * @param sym Symbol to find the key for. + */ + keyFor(sym: symbol): string; + + // Well-known Symbols + + /** + * A method that determines if a constructor object recognizes an object as one of the + * constructor’s instances. Called by the semantics of the instanceof operator. + */ + hasInstance: symbol; + + /** + * A Boolean value that if true indicates that an object should flatten to its array elements + * by Array.prototype.concat. + */ + isConcatSpreadable: symbol; + + /** + * A method that returns the default iterator for an object. Called by the semantics of the + * for-of statement. + */ + iterator: symbol; + + /** + * A regular expression method that matches the regular expression against a string. Called + * by the String.prototype.match method. + */ + match: symbol; + + /** + * A regular expression method that replaces matched substrings of a string. Called by the + * String.prototype.replace method. + */ + replace: symbol; + + /** + * A regular expression method that returns the index within a string that matches the + * regular expression. Called by the String.prototype.search method. + */ + search: symbol; + + /** + * A function valued property that is the constructor function that is used to create + * derived objects. + */ + species: symbol; + + /** + * A regular expression method that splits a string at the indices that match the regular + * expression. Called by the String.prototype.split method. + */ + split: symbol; + + /** + * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive + * abstract operation. + */ + toPrimitive: symbol; + + /** + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. + */ + toStringTag: symbol; + + /** + * An Object whose own property names are property names that are excluded from the with + * environment bindings of the associated objects. + */ + unscopables: symbol; +} +declare var Symbol: SymbolConstructor; + +interface Object { + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: PropertyKey): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: PropertyKey): boolean; +} + +interface ObjectConstructor { + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param sources One or more source objects to copy properties from. + */ + assign(target: any, ...sources: any[]): any; + + /** + * Returns an array of all symbol properties found directly on object o. + * @param o Object to retrieve the symbols from. + */ + getOwnPropertySymbols(o: any): symbol[]; + + /** + * Returns true if the values are the same value, false otherwise. + * @param value1 The first value. + * @param value2 The second value. + */ + is(value1: any, value2: any): boolean; + + /** + * Sets the prototype of a specified object o to object proto or null. Returns the object o. + * @param o The object to change its prototype. + * @param proto The value of the new prototype or null. + */ + setPrototypeOf(o: any, proto: any): any; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not + * inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript + * object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor + * property. + */ + defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; +} + +interface Function { + /** + * Returns a new function object that is identical to the argument object in all ways except + * for its identity and the value of its HomeObject internal slot. + */ + toMethod(newHome: Object): Function; + + /** + * Returns the name of the function. Function names are read-only and can not be changed. + */ + name: string; +} + +interface NumberConstructor { + /** + * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 + * that is representable as a Number value, which is approximately: + * 2.2204460492503130808472633361816 x 10‍−‍16. + */ + EPSILON: number; + + /** + * Returns true if passed value is finite. + * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a + * number. Only finite values of the type number, result in true. + * @param number A numeric value. + */ + isFinite(number: number): boolean; + + /** + * Returns true if the value passed is an integer, false otherwise. + * @param number A numeric value. + */ + isInteger(number: number): boolean; + + /** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a + * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter + * to a number. Only values of the type number, that are also NaN, result in true. + * @param number A numeric value. + */ + isNaN(number: number): boolean; + + /** + * Returns true if the value passed is a safe integer. + * @param number A numeric value. + */ + isSafeInteger(number: number): boolean; + + /** + * The value of the largest integer n such that n and n + 1 are both exactly representable as + * a Number value. + * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1. + */ + MAX_SAFE_INTEGER: number; + + /** + * The value of the smallest integer n such that n and n − 1 are both exactly representable as + * a Number value. + * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). + */ + MIN_SAFE_INTEGER: number; + + /** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ + parseFloat(string: string): number; + + /** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ + parseInt(string: string, radix?: number): number; +} + +interface ArrayLike { + length: number; + [n: number]: T; +} + +interface Array { + /** Iterator */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, T]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: T) => boolean, thisArg?: any): number; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: T, start?: number, end?: number): T[]; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): T[]; +} + +interface ArrayConstructor { + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; + + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array; + + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + */ + from(arrayLike: ArrayLike): Array; + + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + */ + from(iterable: Iterable): Array; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: T[]): Array; +} + +interface String { + /** Iterator */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point + * value of the UTF-16 encoded code point starting at the string element at position pos in + * the String resulting from converting this object to a String. + * If there is no element at that position, the result is undefined. + * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. + */ + codePointAt(pos: number): number; + + /** + * Returns true if searchString appears as a substring of the result of converting this + * object to a String, at one or more positions that are + * greater than or equal to position; otherwise, returns false. + * @param searchString search string + * @param position If position is undefined, 0 is assumed, so as to search all of the String. + */ + contains(searchString: string, position?: number): boolean; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * endPosition – length(this). Otherwise returns false. + */ + endsWith(searchString: string, endPosition?: number): boolean; + + /** + * Returns the String value result of normalizing the string into the normalization form + * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. + * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default + * is "NFC" + */ + normalize(form?: string): string; + + /** + * Returns a String value that is made from count copies appended together. If count is 0, + * T is the empty String is returned. + * @param count number of copies to append + */ + repeat(count: number): string; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * position. Otherwise returns false. + */ + startsWith(searchString: string, position?: number): boolean; + + /** + * Returns an HTML anchor element and sets the name attribute to the text value + * @param name + */ + anchor(name: string): string; + + /** Returns a HTML element */ + big(): string; + + /** Returns a HTML element */ + blink(): string; + + /** Returns a HTML element */ + bold(): string; + + /** Returns a HTML element */ + fixed(): string + + /** Returns a HTML element and sets the color attribute value */ + fontcolor(color: string): string + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: number): string; + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: string): string; + + /** Returns an HTML element */ + italics(): string; + + /** Returns an HTML element and sets the href attribute value */ + link(url: string): string; + + /** Returns a HTML element */ + small(): string; + + /** Returns a HTML element */ + strike(): string; + + /** Returns a HTML element */ + sub(): string; + + /** Returns a HTML element */ + sup(): string; +} + +interface StringConstructor { + /** + * Return the String value whose elements are, in order, the elements in the List elements. + * If length is 0, the empty string is returned. + */ + fromCodePoint(...codePoints: number[]): string; + + /** + * String.raw is intended for use as a tag function of a Tagged Template String. When called + * as such the first argument will be a well formed template call site object and the rest + * parameter will contain the substitution values. + * @param template A well-formed template string call site representation. + * @param substitutions A set of substitution values. + */ + raw(template: TemplateStringsArray, ...substitutions: any[]): string; +} + +interface IteratorResult { + done: boolean; + value?: T; +} + +interface Iterator { + next(value?: any): IteratorResult; + return?(value?: any): IteratorResult; + throw?(e?: any): IteratorResult; +} + +interface Iterable { + [Symbol.iterator](): Iterator; +} + +interface IterableIterator extends Iterator { + [Symbol.iterator](): IterableIterator; +} + +interface GeneratorFunction extends Function { + +} + +interface GeneratorFunctionConstructor { + /** + * Creates a new Generator function. + * @param args A list of arguments the function accepts. + */ + new (...args: string[]): GeneratorFunction; + (...args: string[]): GeneratorFunction; + prototype: GeneratorFunction; +} +declare var GeneratorFunction: GeneratorFunctionConstructor; + +interface Generator extends IterableIterator { + next(value?: any): IteratorResult; + throw(exception: any): IteratorResult; + return(value: T): IteratorResult; + [Symbol.iterator](): Generator; + [Symbol.toStringTag]: string; +} + +interface Math { + /** + * Returns the number of leading zero bits in the 32-bit binary representation of a number. + * @param x A numeric expression. + */ + clz32(x: number): number; + + /** + * Returns the result of 32-bit multiplication of two numbers. + * @param x First number + * @param y Second number + */ + imul(x: number, y: number): number; + + /** + * Returns the sign of the x, indicating whether x is positive, negative or zero. + * @param x The numeric expression to test + */ + sign(x: number): number; + + /** + * Returns the base 10 logarithm of a number. + * @param x A numeric expression. + */ + log10(x: number): number; + + /** + * Returns the base 2 logarithm of a number. + * @param x A numeric expression. + */ + log2(x: number): number; + + /** + * Returns the natural logarithm of 1 + x. + * @param x A numeric expression. + */ + log1p(x: number): number; + + /** + * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of + * the natural logarithms). + * @param x A numeric expression. + */ + expm1(x: number): number; + + /** + * Returns the hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cosh(x: number): number; + + /** + * Returns the hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sinh(x: number): number; + + /** + * Returns the hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tanh(x: number): number; + + /** + * Returns the inverse hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + acosh(x: number): number; + + /** + * Returns the inverse hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + asinh(x: number): number; + + /** + * Returns the inverse hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + atanh(x: number): number; + + /** + * Returns the square root of the sum of squares of its arguments. + * @param values Values to compute the square root for. + * If no arguments are passed, the result is +0. + * If there is only one argument, the result is the absolute value. + * If any argument is +Infinity or -Infinity, the result is +Infinity. + * If any argument is NaN, the result is NaN. + * If all arguments are either +0 or −0, the result is +0. + */ + hypot(...values: number[] ): number; + + /** + * Returns the integral part of the a numeric expression, x, removing any fractional digits. + * If x is already an integer, the result is x. + * @param x A numeric expression. + */ + trunc(x: number): number; + + /** + * Returns the nearest single precision float representation of a number. + * @param x A numeric expression. + */ + fround(x: number): number; + + /** + * Returns an implementation-dependent approximation to the cube root of number. + * @param x A numeric expression. + */ + cbrt(x: number): number; + + [Symbol.toStringTag]: string; +} + +interface RegExp { + /** + * Matches a string with a regular expression, and returns an array containing the results of + * that search. + * @param string A string to search within. + */ + match(string: string): string[]; + + /** + * Replaces text in a string, using a regular expression. + * @param searchValue A String object or string literal that represents the regular expression + * @param replaceValue A String object or string literal containing the text to replace for every + * successful match of rgExp in stringObj. + */ + replace(string: string, replaceValue: string): string; + + search(string: string): number; + + /** + * Returns an Array object into which substrings of the result of converting string to a String + * have been stored. The substrings are determined by searching from left to right for matches + * of the this value regular expression; these occurrences are not part of any substring in the + * returned array, but serve to divide up the String value. + * + * If the regular expression that contains capturing parentheses, then each time separator is + * matched the results (including any undefined results) of the capturing parentheses are spliced. + * @param string string value to split + * @param limit if not undefined, the output array is truncated so that it contains no more + * than limit elements. + */ + split(string: string, limit?: number): string[]; + + /** + * Returns a string indicating the flags of the regular expression in question. This field is read-only. + * The characters in this string are sequenced and concatenated in the following order: + * + * - "g" for global + * - "i" for ignoreCase + * - "m" for multiline + * - "u" for unicode + * - "y" for sticky + * + * If no flags are set, the value is the empty string. + */ + flags: string; + + /** + * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular + * expression. Default is false. Read-only. + */ + sticky: boolean; + + /** + * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular + * expression. Default is false. Read-only. + */ + unicode: boolean; +} + +interface Map { + clear(): void; + delete(key: K): boolean; + entries(): IterableIterator<[K, V]>; + forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; + get(key: K): V; + has(key: K): boolean; + keys(): IterableIterator; + set(key: K, value?: V): Map; + size: number; + values(): IterableIterator; + [Symbol.iterator]():IterableIterator<[K,V]>; + [Symbol.toStringTag]: string; +} + +interface MapConstructor { + new (): Map; + new (iterable: Iterable<[K, V]>): Map; + prototype: Map; +} +declare var Map: MapConstructor; + +interface WeakMap { + clear(): void; + delete(key: K): boolean; + get(key: K): V; + has(key: K): boolean; + set(key: K, value?: V): WeakMap; + [Symbol.toStringTag]: string; +} + +interface WeakMapConstructor { + new (): WeakMap; + new (iterable: Iterable<[K, V]>): WeakMap; + prototype: WeakMap; +} +declare var WeakMap: WeakMapConstructor; + +interface Set { + add(value: T): Set; + clear(): void; + delete(value: T): boolean; + entries(): IterableIterator<[T, T]>; + forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; + has(value: T): boolean; + keys(): IterableIterator; + size: number; + values(): IterableIterator; + [Symbol.iterator]():IterableIterator; + [Symbol.toStringTag]: string; +} + +interface SetConstructor { + new (): Set; + new (iterable: Iterable): Set; + prototype: Set; +} +declare var Set: SetConstructor; + +interface WeakSet { + add(value: T): WeakSet; + clear(): void; + delete(value: T): boolean; + has(value: T): boolean; + [Symbol.toStringTag]: string; +} + +interface WeakSetConstructor { + new (): WeakSet; + new (iterable: Iterable): WeakSet; + prototype: WeakSet; +} +declare var WeakSet: WeakSetConstructor; + +interface JSON { + [Symbol.toStringTag]: string; +} + +/** + * Represents a raw buffer of binary data, which is used to store data for the + * different typed arrays. ArrayBuffers cannot be read from or written to directly, + * but can be passed to a typed array or DataView Object to interpret the raw + * buffer as needed. + */ +interface ArrayBuffer { + /** + * Read-only. The length of the ArrayBuffer (in bytes). + */ + byteLength: number; + + /** + * Returns a section of an ArrayBuffer. + */ + slice(begin: number, end?: number): ArrayBuffer; + + [Symbol.toStringTag]: string; +} + +interface ArrayBufferConstructor { + prototype: ArrayBuffer; + new (byteLength: number): ArrayBuffer; + isView(arg: any): boolean; +} +declare var ArrayBuffer: ArrayBufferConstructor; + +interface DataView { + buffer: ArrayBuffer; + byteLength: number; + byteOffset: number; + /** + * Gets the Float32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat32(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Float64 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getFloat64(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Int8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt8(byteOffset: number): number; + + /** + * Gets the Int16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt16(byteOffset: number, littleEndian: boolean): number; + /** + * Gets the Int32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getInt32(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Uint8 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint8(byteOffset: number): number; + + /** + * Gets the Uint16 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint16(byteOffset: number, littleEndian: boolean): number; + + /** + * Gets the Uint32 value at the specified byte offset from the start of the view. There is + * no alignment constraint; multi-byte values may be fetched from any offset. + * @param byteOffset The place in the buffer at which the value should be retrieved. + */ + getUint32(byteOffset: number, littleEndian: boolean): number; + + /** + * Stores an Float32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat32(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Float64 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setFloat64(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Int8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setInt8(byteOffset: number, value: number): void; + + /** + * Stores an Int16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt16(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Int32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setInt32(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Uint8 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + */ + setUint8(byteOffset: number, value: number): void; + + /** + * Stores an Uint16 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint16(byteOffset: number, value: number, littleEndian: boolean): void; + + /** + * Stores an Uint32 value at the specified byte offset from the start of the view. + * @param byteOffset The place in the buffer at which the value should be set. + * @param value The value to set. + * @param littleEndian If false or undefined, a big-endian value should be written, + * otherwise a little-endian value should be written. + */ + setUint32(byteOffset: number, value: number, littleEndian: boolean): void; + + [Symbol.toStringTag]: string; +} + +interface DataViewConstructor { + new (buffer: ArrayBuffer, byteOffset?: number, byteLength?: number): DataView; +} +declare var DataView: DataViewConstructor; + +/** + * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Int8Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int8Array; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int8Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): Int8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int8Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int8Array, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Int8Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int8Array; + + /** + * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; + + [index: number]: number; + [Symbol.iterator](): IterableIterator; +} + +interface Int8ArrayConstructor { + prototype: Int8Array; + new (length: number): Int8Array; + new (array: Int8Array): Int8Array; + new (array: number[]): Int8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; + + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; +} +declare var Int8Array: Int8ArrayConstructor; + +/** + * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint8Array; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint8Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): Uint8Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint8Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint8Array, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint8Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint8Array; + + /** + * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint8Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; + + [index: number]: number; + [Symbol.iterator](): IterableIterator; +} + +interface Uint8ArrayConstructor { + prototype: Uint8Array; + new (length: number): Uint8Array; + new (array: Uint8Array): Uint8Array; + new (array: number[]): Uint8Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; + + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint8Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; +} +declare var Uint8Array: Uint8ArrayConstructor; + +/** + * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0. + * If the requested number of bytes could not be allocated an exception is raised. + */ +interface Uint8ClampedArray { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint8ClampedArray; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint8ClampedArray; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): Uint8ClampedArray; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint8ClampedArray; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint8ClampedArray, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint8ClampedArray; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint8ClampedArray; + + /** + * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint8ClampedArray; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; + + [index: number]: number; + [Symbol.iterator](): IterableIterator; +} + +interface Uint8ClampedArrayConstructor { + prototype: Uint8ClampedArray; + new (length: number): Uint8ClampedArray; + new (array: Uint8ClampedArray): Uint8ClampedArray; + new (array: number[]): Uint8ClampedArray; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray; + + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint8ClampedArray; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; +} +declare var Uint8ClampedArray: Uint8ClampedArrayConstructor; + +/** + * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int16Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int16Array; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int16Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): Int16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int16Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int16Array, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Int16Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int16Array; + + /** + * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; + + [index: number]: number; + [Symbol.iterator](): IterableIterator; +} + +interface Int16ArrayConstructor { + prototype: Int16Array; + new (length: number): Int16Array; + new (array: Int16Array): Int16Array; + new (array: number[]): Int16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; + + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; +} +declare var Int16Array: Int16ArrayConstructor; + +/** + * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint16Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint16Array; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint16Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): Uint16Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint16Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint16Array, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint16Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint16Array; + + /** + * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint16Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; + + [index: number]: number; + [Symbol.iterator](): IterableIterator; +} + +interface Uint16ArrayConstructor { + prototype: Uint16Array; + new (length: number): Uint16Array; + new (array: Uint16Array): Uint16Array; + new (array: number[]): Uint16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; + + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint16Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; +} +declare var Uint16Array: Uint16ArrayConstructor; + +/** + * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Int32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Int32Array; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Int32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): Int32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Int32Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Int32Array, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Int32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Int32Array; + + /** + * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Int32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; + + [index: number]: number; + [Symbol.iterator](): IterableIterator; +} + +interface Int32ArrayConstructor { + prototype: Int32Array; + new (length: number): Int32Array; + new (array: Int32Array): Int32Array; + new (array: number[]): Int32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; + + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Int32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; +} +declare var Int32Array: Int32ArrayConstructor; + +/** + * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the + * requested number of bytes could not be allocated an exception is raised. + */ +interface Uint32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Uint32Array; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Uint32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): Uint32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Uint32Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Uint32Array, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Uint32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Uint32Array; + + /** + * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Uint32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; + + [index: number]: number; + [Symbol.iterator](): IterableIterator; +} + +interface Uint32ArrayConstructor { + prototype: Uint32Array; + new (length: number): Uint32Array; + new (array: Uint32Array): Uint32Array; + new (array: number[]): Uint32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; + + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Uint32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; +} +declare var Uint32Array: Uint32ArrayConstructor; + +/** + * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number + * of bytes could not be allocated an exception is raised. + */ +interface Float32Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Float32Array; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Float32Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): Float32Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float32Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Float32Array, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Float32Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Float32Array; + + /** + * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float32Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; + + [index: number]: number; + [Symbol.iterator](): IterableIterator; +} + +interface Float32ArrayConstructor { + prototype: Float32Array; + new (length: number): Float32Array; + new (array: Float32Array): Float32Array; + new (array: number[]): Float32Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; + + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float32Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; +} +declare var Float32Array: Float32ArrayConstructor; + +/** + * A typed array of 64-bit float values. The contents are initialized to 0. If the requested + * number of bytes could not be allocated an exception is raised. + */ +interface Float64Array { + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): Float64Array; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, number]>; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls + * the callbackfn function for each element in array1 until the callbackfn returns false, + * or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: number, start?: number, end?: number): Float64Array; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls + * the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + filter(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): Float64Array; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: number, index: number, obj: Array) => boolean, thisArg?: any): number; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: number) => boolean, thisArg?: any): number; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + indexOf(searchElement: number, fromIndex?: number): number; + + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the + * resulting String. If omitted, the array elements are separated with a comma. + */ + join(separator?: string): string; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns the index of the last occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the + * search starts at index 0. + */ + lastIndexOf(searchElement: number, fromIndex?: number): number; + + /** + * The length of the array. + */ + length: number; + + /** + * Calls a defined callback function on each element of an array, and returns an array that + * contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the + * callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array. The return value of + * the callback function is the accumulated result, and is provided as an argument in the next + * call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the + * callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an + * argument instead of an array value. + */ + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an + * argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls + * the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start + * the accumulation. The first call to the callbackfn function provides this value as an argument + * instead of an array value. + */ + reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U; + + /** + * Reverses the elements in an Array. + */ + reverse(): Float64Array; + + /** + * Sets a value or an array of values. + * @param index The index of the location to set. + * @param value The value to set. + */ + set(index: number, value: number): void; + + /** + * Sets a value or an array of values. + * @param array A typed or untyped array of values to set. + * @param offset The index in the current array at which the values are to be written. + */ + set(array: Float64Array, offset?: number): void; + + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(start?: number, end?: number): Float64Array; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the + * callbackfn function for each element in array1 until the callbackfn returns true, or until + * the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. + * If thisArg is omitted, undefined is used as the this value. + */ + some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If + * omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(compareFn?: (a: number, b: number) => number): Float64Array; + + /** + * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements + * at begin, inclusive, up to end, exclusive. + * @param begin The index of the beginning of the array. + * @param end The index of the end of the array. + */ + subarray(begin: number, end?: number): Float64Array; + + /** + * Converts a number to a string by using the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of an array. + */ + toString(): string; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; + + [index: number]: number; + [Symbol.iterator](): IterableIterator; +} + +interface Float64ArrayConstructor { + prototype: Float64Array; + new (length: number): Float64Array; + new (array: Float64Array): Float64Array; + new (array: number[]): Float64Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; + + /** + * The size in bytes of each element in the array. + */ + BYTES_PER_ELEMENT: number; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: number[]): Float64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param arrayLike An array-like or iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike | Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; +} +declare var Float64Array: Float64ArrayConstructor; + +interface ProxyHandler { + getPrototypeOf? (target: T): any; + setPrototypeOf? (target: T, v: any): boolean; + isExtensible? (target: T): boolean; + preventExtensions? (target: T): boolean; + getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor; + has? (target: T, p: PropertyKey): boolean; + get? (target: T, p: PropertyKey, receiver: any): any; + set? (target: T, p: PropertyKey, value: any, receiver: any): boolean; + deleteProperty? (target: T, p: PropertyKey): boolean; + defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean; + enumerate? (target: T): PropertyKey[]; + ownKeys? (target: T): PropertyKey[]; + apply? (target: T, thisArg: any, argArray?: any): any; + construct? (target: T, thisArg: any, argArray?: any): any; +} + +interface ProxyConstructor { + revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; }; + new (target: T, handler: ProxyHandler): T +} +declare var Proxy: ProxyConstructor; + +declare module Reflect { + function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; + function construct(target: Function, argumentsList: ArrayLike): any; + function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; + function deleteProperty(target: any, propertyKey: PropertyKey): boolean; + function enumerate(target: any): IterableIterator; + function get(target: any, propertyKey: PropertyKey, receiver?: any): any; + function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; + function getPrototypeOf(target: any): any; + function has(target: any, propertyKey: string): boolean; + function has(target: any, propertyKey: symbol): boolean; + function isExtensible(target: any): boolean; + function ownKeys(target: any): Array; + function preventExtensions(target: any): boolean; + function set(target: any, propertyKey: PropertyKey, value: any, receiver? :any): boolean; + function setPrototypeOf(target: any, proto: any): boolean; +} + +interface PromiseLike { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; +} + +/** + * Represents the completion of an asynchronous operation + */ +interface Promise { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; + + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: (reason: any) => T | PromiseLike): Promise; + + [Symbol.toStringTag]: string; +} + +interface PromiseConstructor { + /** + * A reference to the prototype. + */ + prototype: Promise; + + /** + * Creates a new Promise. + * @param executor A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used resolve the promise with a value or the result of another promise, + * and a reject callback used to reject the promise with a provided reason or error. + */ + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: Iterable>): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: Iterable>): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new resolved promise for the provided value. + * @param value A promise. + * @returns A promise whose internal state matches the provided promise. + */ + resolve(value: T | PromiseLike): Promise; + + /** + * Creates a new resolved promise . + * @returns A resolved promise. + */ + resolve(): Promise; + + [Symbol.species]: Function; +} + +declare var Promise: PromiseConstructor; + +interface ArrayBufferView { + /** + * The ArrayBuffer instance referenced by the array. + */ + buffer: ArrayBuffer; + + /** + * The length in bytes of the array. + */ + byteLength: number; + + /** + * The offset in bytes of the array. + */ + byteOffset: number; +}///////////////////////////// +/// ECMAScript Internationalization API +///////////////////////////// + +declare module Intl { + interface CollatorOptions { + usage?: string; + localeMatcher?: string; + numeric?: boolean; + caseFirst?: string; + sensitivity?: string; + ignorePunctuation?: boolean; + } + + interface ResolvedCollatorOptions { + locale: string; + usage: string; + sensitivity: string; + ignorePunctuation: boolean; + collation: string; + caseFirst: string; + numeric: boolean; + } + + interface Collator { + compare(x: string, y: string): number; + resolvedOptions(): ResolvedCollatorOptions; + } + var Collator: { + new (locales?: string[], options?: CollatorOptions): Collator; + new (locale?: string, options?: CollatorOptions): Collator; + (locales?: string[], options?: CollatorOptions): Collator; + (locale?: string, options?: CollatorOptions): Collator; + supportedLocalesOf(locales: string[], options?: CollatorOptions): string[]; + supportedLocalesOf(locale: string, options?: CollatorOptions): string[]; + } + + interface NumberFormatOptions { + localeMatcher?: string; + style?: string; + currency?: string; + currencyDisplay?: string; + useGrouping?: boolean; + } + + interface ResolvedNumberFormatOptions { + locale: string; + numberingSystem: string; + style: string; + currency?: string; + currencyDisplay?: string; + minimumintegerDigits: number; + minimumFractionDigits: number; + maximumFractionDigits: number; + minimumSignificantDigits?: number; + maximumSignificantDigits?: number; + useGrouping: boolean; + } + + interface NumberFormat { + format(value: number): string; + resolvedOptions(): ResolvedNumberFormatOptions; + } + var NumberFormat: { + new (locales?: string[], options?: NumberFormatOptions): Collator; + new (locale?: string, options?: NumberFormatOptions): Collator; + (locales?: string[], options?: NumberFormatOptions): Collator; + (locale?: string, options?: NumberFormatOptions): Collator; + supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[]; + supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[]; + } + + interface DateTimeFormatOptions { + localeMatcher?: string; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + formatMatcher?: string; + hour12?: boolean; + } + + interface ResolvedDateTimeFormatOptions { + locale: string; + calendar: string; + numberingSystem: string; + timeZone: string; + hour12?: boolean; + weekday?: string; + era?: string; + year?: string; + month?: string; + day?: string; + hour?: string; + minute?: string; + second?: string; + timeZoneName?: string; + } + + interface DateTimeFormat { + format(date: number): string; + resolvedOptions(): ResolvedDateTimeFormatOptions; + } + var DateTimeFormat: { + new (locales?: string[], options?: DateTimeFormatOptions): Collator; + new (locale?: string, options?: DateTimeFormatOptions): Collator; + (locales?: string[], options?: DateTimeFormatOptions): Collator; + (locale?: string, options?: DateTimeFormatOptions): Collator; + supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[]; + supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[]; + } +} + +interface String { + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number; + + /** + * Determines whether two strings are equivalent in the current locale. + * @param that String to compare to target string + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details. + * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details. + */ + localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number; +} + +interface Number { + /** + * Converts a number to a string by using the current or specified locale. + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string; + + /** + * Converts a number to a string by using the current or specified locale. + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string; +} + +interface Date { + /** + * Converts a date to a string by using the current or specified locale. + * @param locales An array of locale strings that contain one or more language or locale tags. If you include more than one locale string, list them in descending order of priority so that the first entry is the preferred locale. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; + + /** + * Converts a date to a string by using the current or specified locale. + * @param locale Locale tag. If you omit this parameter, the default locale of the JavaScript runtime is used. + * @param options An object that contains one or more properties that specify comparison options. + */ + toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; +} + + +///////////////////////////// +/// IE DOM APIs +///////////////////////////// + +interface Algorithm { + name?: string; +} + +interface AriaRequestEventInit extends EventInit { + attributeName?: string; + attributeValue?: string; +} + +interface ClipboardEventInit extends EventInit { + data?: string; + dataType?: string; +} + +interface CommandEventInit extends EventInit { + commandName?: string; + detail?: string; +} + +interface CompositionEventInit extends UIEventInit { + data?: string; +} + +interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { + arrayOfDomainStrings?: string[]; +} + +interface CustomEventInit extends EventInit { + detail?: any; +} + +interface DeviceAccelerationDict { + x?: number; + y?: number; + z?: number; +} + +interface DeviceRotationRateDict { + alpha?: number; + beta?: number; + gamma?: number; +} + +interface EventInit { + bubbles?: boolean; + cancelable?: boolean; +} + +interface ExceptionInformation { + domain?: string; +} + +interface FocusEventInit extends UIEventInit { + relatedTarget?: EventTarget; +} + +interface HashChangeEventInit extends EventInit { + newURL?: string; + oldURL?: string; +} + +interface KeyAlgorithm { + name?: string; +} + +interface KeyboardEventInit extends SharedKeyboardAndMouseEventInit { + key?: string; + location?: number; + repeat?: boolean; +} + +interface MouseEventInit extends SharedKeyboardAndMouseEventInit { + screenX?: number; + screenY?: number; + clientX?: number; + clientY?: number; + button?: number; + buttons?: number; + relatedTarget?: EventTarget; +} + +interface MsZoomToOptions { + contentX?: number; + contentY?: number; + viewportX?: string; + viewportY?: string; + scaleFactor?: number; + animate?: string; +} + +interface MutationObserverInit { + childList?: boolean; + attributes?: boolean; + characterData?: boolean; + subtree?: boolean; + attributeOldValue?: boolean; + characterDataOldValue?: boolean; + attributeFilter?: string[]; +} + +interface ObjectURLOptions { + oneTimeOnly?: boolean; +} + +interface PointerEventInit extends MouseEventInit { + pointerId?: number; + width?: number; + height?: number; + pressure?: number; + tiltX?: number; + tiltY?: number; + pointerType?: string; + isPrimary?: boolean; +} + +interface PositionOptions { + enableHighAccuracy?: boolean; + timeout?: number; + maximumAge?: number; +} + +interface SharedKeyboardAndMouseEventInit extends UIEventInit { + ctrlKey?: boolean; + shiftKey?: boolean; + altKey?: boolean; + metaKey?: boolean; + keyModifierStateAltGraph?: boolean; + keyModifierStateCapsLock?: boolean; + keyModifierStateFn?: boolean; + keyModifierStateFnLock?: boolean; + keyModifierStateHyper?: boolean; + keyModifierStateNumLock?: boolean; + keyModifierStateOS?: boolean; + keyModifierStateScrollLock?: boolean; + keyModifierStateSuper?: boolean; + keyModifierStateSymbol?: boolean; + keyModifierStateSymbolLock?: boolean; +} + +interface StoreExceptionsInformation extends ExceptionInformation { + siteName?: string; + explanationString?: string; + detailURI?: string; +} + +interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { + arrayOfDomainStrings?: string[]; +} + +interface UIEventInit extends EventInit { + view?: Window; + detail?: number; +} + +interface WebGLContextAttributes { + alpha?: boolean; + depth?: boolean; + stencil?: boolean; + antialias?: boolean; + premultipliedAlpha?: boolean; + preserveDrawingBuffer?: boolean; +} + +interface WebGLContextEventInit extends EventInit { + statusMessage?: string; +} + +interface WheelEventInit extends MouseEventInit { + deltaX?: number; + deltaY?: number; + deltaZ?: number; + deltaMode?: number; +} + +interface EventListener { + (evt: Event): void; +} + +interface ANGLE_instanced_arrays { + drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void; + drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void; + vertexAttribDivisorANGLE(index: number, divisor: number): void; + VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +declare var ANGLE_instanced_arrays: { + prototype: ANGLE_instanced_arrays; + new(): ANGLE_instanced_arrays; + VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number; +} + +interface AnalyserNode extends AudioNode { + fftSize: number; + frequencyBinCount: number; + maxDecibels: number; + minDecibels: number; + smoothingTimeConstant: number; + getByteFrequencyData(array: Uint8Array): void; + getByteTimeDomainData(array: Uint8Array): void; + getFloatFrequencyData(array: any): void; + getFloatTimeDomainData(array: any): void; +} + +declare var AnalyserNode: { + prototype: AnalyserNode; + new(): AnalyserNode; +} + +interface AnimationEvent extends Event { + animationName: string; + elapsedTime: number; + initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; +} + +declare var AnimationEvent: { + prototype: AnimationEvent; + new(): AnimationEvent; +} + +interface ApplicationCache extends EventTarget { + oncached: (ev: Event) => any; + onchecking: (ev: Event) => any; + ondownloading: (ev: Event) => any; + onerror: (ev: Event) => any; + onnoupdate: (ev: Event) => any; + onobsolete: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + onupdateready: (ev: Event) => any; + status: number; + abort(): void; + swapCache(): void; + update(): void; + CHECKING: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; + UNCACHED: number; + UPDATEREADY: number; + addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ApplicationCache: { + prototype: ApplicationCache; + new(): ApplicationCache; + CHECKING: number; + DOWNLOADING: number; + IDLE: number; + OBSOLETE: number; + UNCACHED: number; + UPDATEREADY: number; +} + +interface AriaRequestEvent extends Event { + attributeName: string; + attributeValue: string; +} + +declare var AriaRequestEvent: { + prototype: AriaRequestEvent; + new(type: string, eventInitDict?: AriaRequestEventInit): AriaRequestEvent; +} + +interface Attr extends Node { + name: string; + ownerElement: Element; + specified: boolean; + value: string; +} + +declare var Attr: { + prototype: Attr; + new(): Attr; +} + +interface AudioBuffer { + duration: number; + length: number; + numberOfChannels: number; + sampleRate: number; + getChannelData(channel: number): any; +} + +declare var AudioBuffer: { + prototype: AudioBuffer; + new(): AudioBuffer; +} + +interface AudioBufferSourceNode extends AudioNode { + buffer: AudioBuffer; + loop: boolean; + loopEnd: number; + loopStart: number; + onended: (ev: Event) => any; + playbackRate: AudioParam; + start(when?: number, offset?: number, duration?: number): void; + stop(when?: number): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var AudioBufferSourceNode: { + prototype: AudioBufferSourceNode; + new(): AudioBufferSourceNode; +} + +interface AudioContext extends EventTarget { + currentTime: number; + destination: AudioDestinationNode; + listener: AudioListener; + sampleRate: number; + createAnalyser(): AnalyserNode; + createBiquadFilter(): BiquadFilterNode; + createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; + createBufferSource(): AudioBufferSourceNode; + createChannelMerger(numberOfInputs?: number): ChannelMergerNode; + createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; + createConvolver(): ConvolverNode; + createDelay(maxDelayTime?: number): DelayNode; + createDynamicsCompressor(): DynamicsCompressorNode; + createGain(): GainNode; + createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; + createOscillator(): OscillatorNode; + createPanner(): PannerNode; + createPeriodicWave(real: any, imag: any): PeriodicWave; + createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; + createStereoPanner(): StereoPannerNode; + createWaveShaper(): WaveShaperNode; + decodeAudioData(audioData: ArrayBuffer, successCallback: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): void; +} + +declare var AudioContext: { + prototype: AudioContext; + new(): AudioContext; +} + +interface AudioDestinationNode extends AudioNode { + maxChannelCount: number; +} + +declare var AudioDestinationNode: { + prototype: AudioDestinationNode; + new(): AudioDestinationNode; +} + +interface AudioListener { + dopplerFactor: number; + speedOfSound: number; + setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var AudioListener: { + prototype: AudioListener; + new(): AudioListener; +} + +interface AudioNode extends EventTarget { + channelCount: number; + channelCountMode: string; + channelInterpretation: string; + context: AudioContext; + numberOfInputs: number; + numberOfOutputs: number; + connect(destination: AudioNode, output?: number, input?: number): void; + disconnect(output?: number): void; +} + +declare var AudioNode: { + prototype: AudioNode; + new(): AudioNode; +} + +interface AudioParam { + defaultValue: number; + value: number; + cancelScheduledValues(startTime: number): void; + exponentialRampToValueAtTime(value: number, endTime: number): void; + linearRampToValueAtTime(value: number, endTime: number): void; + setTargetAtTime(target: number, startTime: number, timeConstant: number): void; + setValueAtTime(value: number, startTime: number): void; + setValueCurveAtTime(values: any, startTime: number, duration: number): void; +} + +declare var AudioParam: { + prototype: AudioParam; + new(): AudioParam; +} + +interface AudioProcessingEvent extends Event { + inputBuffer: AudioBuffer; + outputBuffer: AudioBuffer; + playbackTime: number; +} + +declare var AudioProcessingEvent: { + prototype: AudioProcessingEvent; + new(): AudioProcessingEvent; +} + +interface AudioTrack { + enabled: boolean; + id: string; + kind: string; + label: string; + language: string; + sourceBuffer: SourceBuffer; +} + +declare var AudioTrack: { + prototype: AudioTrack; + new(): AudioTrack; +} + +interface AudioTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + onchange: (ev: Event) => any; + onremovetrack: (ev: TrackEvent) => any; + getTrackById(id: string): AudioTrack; + item(index: number): AudioTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: AudioTrack; +} + +declare var AudioTrackList: { + prototype: AudioTrackList; + new(): AudioTrackList; +} + +interface BarProp { + visible: boolean; +} + +declare var BarProp: { + prototype: BarProp; + new(): BarProp; +} + +interface BeforeUnloadEvent extends Event { + returnValue: any; +} + +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +} + +interface BiquadFilterNode extends AudioNode { + Q: AudioParam; + detune: AudioParam; + frequency: AudioParam; + gain: AudioParam; + type: string; + getFrequencyResponse(frequencyHz: any, magResponse: any, phaseResponse: any): void; +} + +declare var BiquadFilterNode: { + prototype: BiquadFilterNode; + new(): BiquadFilterNode; +} + +interface Blob { + size: number; + type: string; + msClose(): void; + msDetachStream(): any; + slice(start?: number, end?: number, contentType?: string): Blob; +} + +declare var Blob: { + prototype: Blob; + new (blobParts?: any[], options?: BlobPropertyBag): Blob; +} + +interface CDATASection extends Text { +} + +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +} + +interface CSS { + supports(property: string, value?: string): boolean; +} +declare var CSS: CSS; + +interface CSSConditionRule extends CSSGroupingRule { + conditionText: string; +} + +declare var CSSConditionRule: { + prototype: CSSConditionRule; + new(): CSSConditionRule; +} + +interface CSSFontFaceRule extends CSSRule { + style: CSSStyleDeclaration; +} + +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +} + +interface CSSGroupingRule extends CSSRule { + cssRules: CSSRuleList; + deleteRule(index?: number): void; + insertRule(rule: string, index?: number): number; +} + +declare var CSSGroupingRule: { + prototype: CSSGroupingRule; + new(): CSSGroupingRule; +} + +interface CSSImportRule extends CSSRule { + href: string; + media: MediaList; + styleSheet: CSSStyleSheet; +} + +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +} + +interface CSSKeyframeRule extends CSSRule { + keyText: string; + style: CSSStyleDeclaration; +} + +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +} + +interface CSSKeyframesRule extends CSSRule { + cssRules: CSSRuleList; + name: string; + appendRule(rule: string): void; + deleteRule(rule: string): void; + findRule(rule: string): CSSKeyframeRule; +} + +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +} + +interface CSSMediaRule extends CSSConditionRule { + media: MediaList; +} + +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +} + +interface CSSNamespaceRule extends CSSRule { + namespaceURI: string; + prefix: string; +} + +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +} + +interface CSSPageRule extends CSSRule { + pseudoClass: string; + selector: string; + selectorText: string; + style: CSSStyleDeclaration; +} + +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +} + +interface CSSRule { + cssText: string; + parentRule: CSSRule; + parentStyleSheet: CSSStyleSheet; + type: number; + CHARSET_RULE: number; + FONT_FACE_RULE: number; + IMPORT_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + MEDIA_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + STYLE_RULE: number; + SUPPORTS_RULE: number; + UNKNOWN_RULE: number; + VIEWPORT_RULE: number; +} + +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + CHARSET_RULE: number; + FONT_FACE_RULE: number; + IMPORT_RULE: number; + KEYFRAMES_RULE: number; + KEYFRAME_RULE: number; + MEDIA_RULE: number; + NAMESPACE_RULE: number; + PAGE_RULE: number; + STYLE_RULE: number; + SUPPORTS_RULE: number; + UNKNOWN_RULE: number; + VIEWPORT_RULE: number; +} + +interface CSSRuleList { + length: number; + item(index: number): CSSRule; + [index: number]: CSSRule; +} + +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +} + +interface CSSStyleDeclaration { + alignContent: string; + alignItems: string; + alignSelf: string; + alignmentBaseline: string; + animation: string; + animationDelay: string; + animationDirection: string; + animationDuration: string; + animationFillMode: string; + animationIterationCount: string; + animationName: string; + animationPlayState: string; + animationTimingFunction: string; + backfaceVisibility: string; + background: string; + backgroundAttachment: string; + backgroundClip: string; + backgroundColor: string; + backgroundImage: string; + backgroundOrigin: string; + backgroundPosition: string; + backgroundPositionX: string; + backgroundPositionY: string; + backgroundRepeat: string; + backgroundSize: string; + baselineShift: string; + border: string; + borderBottom: string; + borderBottomColor: string; + borderBottomLeftRadius: string; + borderBottomRightRadius: string; + borderBottomStyle: string; + borderBottomWidth: string; + borderCollapse: string; + borderColor: string; + borderImage: string; + borderImageOutset: string; + borderImageRepeat: string; + borderImageSlice: string; + borderImageSource: string; + borderImageWidth: string; + borderLeft: string; + borderLeftColor: string; + borderLeftStyle: string; + borderLeftWidth: string; + borderRadius: string; + borderRight: string; + borderRightColor: string; + borderRightStyle: string; + borderRightWidth: string; + borderSpacing: string; + borderStyle: string; + borderTop: string; + borderTopColor: string; + borderTopLeftRadius: string; + borderTopRightRadius: string; + borderTopStyle: string; + borderTopWidth: string; + borderWidth: string; + bottom: string; + boxShadow: string; + boxSizing: string; + breakAfter: string; + breakBefore: string; + breakInside: string; + captionSide: string; + clear: string; + clip: string; + clipPath: string; + clipRule: string; + color: string; + colorInterpolationFilters: string; + columnCount: any; + columnFill: string; + columnGap: any; + columnRule: string; + columnRuleColor: any; + columnRuleStyle: string; + columnRuleWidth: any; + columnSpan: string; + columnWidth: any; + columns: string; + content: string; + counterIncrement: string; + counterReset: string; + cssFloat: string; + cssText: string; + cursor: string; + direction: string; + display: string; + dominantBaseline: string; + emptyCells: string; + enableBackground: string; + fill: string; + fillOpacity: string; + fillRule: string; + filter: string; + flex: string; + flexBasis: string; + flexDirection: string; + flexFlow: string; + flexGrow: string; + flexShrink: string; + flexWrap: string; + floodColor: string; + floodOpacity: string; + font: string; + fontFamily: string; + fontFeatureSettings: string; + fontSize: string; + fontSizeAdjust: string; + fontStretch: string; + fontStyle: string; + fontVariant: string; + fontWeight: string; + glyphOrientationHorizontal: string; + glyphOrientationVertical: string; + height: string; + imeMode: string; + justifyContent: string; + kerning: string; + left: string; + length: number; + letterSpacing: string; + lightingColor: string; + lineHeight: string; + listStyle: string; + listStyleImage: string; + listStylePosition: string; + listStyleType: string; + margin: string; + marginBottom: string; + marginLeft: string; + marginRight: string; + marginTop: string; + marker: string; + markerEnd: string; + markerMid: string; + markerStart: string; + mask: string; + maxHeight: string; + maxWidth: string; + minHeight: string; + minWidth: string; + msContentZoomChaining: string; + msContentZoomLimit: string; + msContentZoomLimitMax: any; + msContentZoomLimitMin: any; + msContentZoomSnap: string; + msContentZoomSnapPoints: string; + msContentZoomSnapType: string; + msContentZooming: string; + msFlowFrom: string; + msFlowInto: string; + msFontFeatureSettings: string; + msGridColumn: any; + msGridColumnAlign: string; + msGridColumnSpan: any; + msGridColumns: string; + msGridRow: any; + msGridRowAlign: string; + msGridRowSpan: any; + msGridRows: string; + msHighContrastAdjust: string; + msHyphenateLimitChars: string; + msHyphenateLimitLines: any; + msHyphenateLimitZone: any; + msHyphens: string; + msImeAlign: string; + msOverflowStyle: string; + msScrollChaining: string; + msScrollLimit: string; + msScrollLimitXMax: any; + msScrollLimitXMin: any; + msScrollLimitYMax: any; + msScrollLimitYMin: any; + msScrollRails: string; + msScrollSnapPointsX: string; + msScrollSnapPointsY: string; + msScrollSnapType: string; + msScrollSnapX: string; + msScrollSnapY: string; + msScrollTranslation: string; + msTextCombineHorizontal: string; + msTextSizeAdjust: any; + msTouchAction: string; + msTouchSelect: string; + msUserSelect: string; + msWrapFlow: string; + msWrapMargin: any; + msWrapThrough: string; + opacity: string; + order: string; + orphans: string; + outline: string; + outlineColor: string; + outlineStyle: string; + outlineWidth: string; + overflow: string; + overflowX: string; + overflowY: string; + padding: string; + paddingBottom: string; + paddingLeft: string; + paddingRight: string; + paddingTop: string; + pageBreakAfter: string; + pageBreakBefore: string; + pageBreakInside: string; + parentRule: CSSRule; + perspective: string; + perspectiveOrigin: string; + pointerEvents: string; + position: string; + quotes: string; + right: string; + rubyAlign: string; + rubyOverhang: string; + rubyPosition: string; + stopColor: string; + stopOpacity: string; + stroke: string; + strokeDasharray: string; + strokeDashoffset: string; + strokeLinecap: string; + strokeLinejoin: string; + strokeMiterlimit: string; + strokeOpacity: string; + strokeWidth: string; + tableLayout: string; + textAlign: string; + textAlignLast: string; + textAnchor: string; + textDecoration: string; + textFillColor: string; + textIndent: string; + textJustify: string; + textKashida: string; + textKashidaSpace: string; + textOverflow: string; + textShadow: string; + textTransform: string; + textUnderlinePosition: string; + top: string; + touchAction: string; + transform: string; + transformOrigin: string; + transformStyle: string; + transition: string; + transitionDelay: string; + transitionDuration: string; + transitionProperty: string; + transitionTimingFunction: string; + unicodeBidi: string; + verticalAlign: string; + visibility: string; + webkitAlignContent: string; + webkitAlignItems: string; + webkitAlignSelf: string; + webkitAnimation: string; + webkitAnimationDelay: string; + webkitAnimationDirection: string; + webkitAnimationDuration: string; + webkitAnimationFillMode: string; + webkitAnimationIterationCount: string; + webkitAnimationName: string; + webkitAnimationPlayState: string; + webkitAnimationTimingFunction: string; + webkitAppearance: string; + webkitBackfaceVisibility: string; + webkitBackground: string; + webkitBackgroundAttachment: string; + webkitBackgroundClip: string; + webkitBackgroundColor: string; + webkitBackgroundImage: string; + webkitBackgroundOrigin: string; + webkitBackgroundPosition: string; + webkitBackgroundPositionX: string; + webkitBackgroundPositionY: string; + webkitBackgroundRepeat: string; + webkitBackgroundSize: string; + webkitBorderBottomLeftRadius: string; + webkitBorderBottomRightRadius: string; + webkitBorderImage: string; + webkitBorderImageOutset: string; + webkitBorderImageRepeat: string; + webkitBorderImageSlice: string; + webkitBorderImageSource: string; + webkitBorderImageWidth: string; + webkitBorderRadius: string; + webkitBorderTopLeftRadius: string; + webkitBorderTopRightRadius: string; + webkitBoxAlign: string; + webkitBoxDirection: string; + webkitBoxFlex: string; + webkitBoxOrdinalGroup: string; + webkitBoxOrient: string; + webkitBoxPack: string; + webkitBoxSizing: string; + webkitColumnBreakAfter: string; + webkitColumnBreakBefore: string; + webkitColumnBreakInside: string; + webkitColumnCount: any; + webkitColumnGap: any; + webkitColumnRule: string; + webkitColumnRuleColor: any; + webkitColumnRuleStyle: string; + webkitColumnRuleWidth: any; + webkitColumnSpan: string; + webkitColumnWidth: any; + webkitColumns: string; + webkitFilter: string; + webkitFlex: string; + webkitFlexBasis: string; + webkitFlexDirection: string; + webkitFlexFlow: string; + webkitFlexGrow: string; + webkitFlexShrink: string; + webkitFlexWrap: string; + webkitJustifyContent: string; + webkitOrder: string; + webkitPerspective: string; + webkitPerspectiveOrigin: string; + webkitTapHighlightColor: string; + webkitTextFillColor: string; + webkitTextSizeAdjust: any; + webkitTransform: string; + webkitTransformOrigin: string; + webkitTransformStyle: string; + webkitTransition: string; + webkitTransitionDelay: string; + webkitTransitionDuration: string; + webkitTransitionProperty: string; + webkitTransitionTimingFunction: string; + webkitUserSelect: string; + webkitWritingMode: string; + whiteSpace: string; + widows: string; + width: string; + wordBreak: string; + wordSpacing: string; + wordWrap: string; + writingMode: string; + zIndex: string; + zoom: string; + getPropertyPriority(propertyName: string): string; + getPropertyValue(propertyName: string): string; + item(index: number): string; + removeProperty(propertyName: string): string; + setProperty(propertyName: string, value: string, priority?: string): void; + [index: number]: string; +} + +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +} + +interface CSSStyleRule extends CSSRule { + readOnly: boolean; + selectorText: string; + style: CSSStyleDeclaration; +} + +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +} + +interface CSSStyleSheet extends StyleSheet { + cssRules: CSSRuleList; + cssText: string; + href: string; + id: string; + imports: StyleSheetList; + isAlternate: boolean; + isPrefAlternate: boolean; + ownerRule: CSSRule; + owningElement: Element; + pages: StyleSheetPageList; + readOnly: boolean; + rules: CSSRuleList; + addImport(bstrURL: string, lIndex?: number): number; + addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; + addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; + deleteRule(index?: number): void; + insertRule(rule: string, index?: number): number; + removeImport(lIndex: number): void; + removeRule(lIndex: number): void; +} + +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(): CSSStyleSheet; +} + +interface CSSSupportsRule extends CSSConditionRule { +} + +declare var CSSSupportsRule: { + prototype: CSSSupportsRule; + new(): CSSSupportsRule; +} + +interface CanvasGradient { + addColorStop(offset: number, color: string): void; +} + +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +} + +interface CanvasPattern { +} + +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +} + +interface CanvasRenderingContext2D { + canvas: HTMLCanvasElement; + fillStyle: any; + font: string; + globalAlpha: number; + globalCompositeOperation: string; + lineCap: string; + lineDashOffset: number; + lineJoin: string; + lineWidth: number; + miterLimit: number; + msFillRule: string; + msImageSmoothingEnabled: boolean; + shadowBlur: number; + shadowColor: string; + shadowOffsetX: number; + shadowOffsetY: number; + strokeStyle: any; + textAlign: string; + textBaseline: string; + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + beginPath(): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + clearRect(x: number, y: number, w: number, h: number): void; + clip(fillRule?: string): void; + closePath(): void; + createImageData(imageDataOrSw: number, sh?: number): ImageData; + createImageData(imageDataOrSw: ImageData, sh?: number): ImageData; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + createPattern(image: HTMLImageElement, repetition: string): CanvasPattern; + createPattern(image: HTMLCanvasElement, repetition: string): CanvasPattern; + createPattern(image: HTMLVideoElement, repetition: string): CanvasPattern; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + drawImage(image: HTMLImageElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + drawImage(image: HTMLCanvasElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + drawImage(image: HTMLVideoElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; + fill(fillRule?: string): void; + fillRect(x: number, y: number, w: number, h: number): void; + fillText(text: string, x: number, y: number, maxWidth?: number): void; + getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; + getLineDash(): number[]; + isPointInPath(x: number, y: number, fillRule?: string): boolean; + lineTo(x: number, y: number): void; + measureText(text: string): TextMetrics; + moveTo(x: number, y: number): void; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + rect(x: number, y: number, w: number, h: number): void; + restore(): void; + rotate(angle: number): void; + save(): void; + scale(x: number, y: number): void; + setLineDash(segments: number[]): void; + setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + stroke(): void; + strokeRect(x: number, y: number, w: number, h: number): void; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; + transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; + translate(x: number, y: number): void; +} + +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +} + +interface ChannelMergerNode extends AudioNode { +} + +declare var ChannelMergerNode: { + prototype: ChannelMergerNode; + new(): ChannelMergerNode; +} + +interface ChannelSplitterNode extends AudioNode { +} + +declare var ChannelSplitterNode: { + prototype: ChannelSplitterNode; + new(): ChannelSplitterNode; +} + +interface CharacterData extends Node, ChildNode { + data: string; + length: number; + appendData(arg: string): void; + deleteData(offset: number, count: number): void; + insertData(offset: number, arg: string): void; + replaceData(offset: number, count: number, arg: string): void; + substringData(offset: number, count: number): string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +} + +interface ClientRect { + bottom: number; + height: number; + left: number; + right: number; + top: number; + width: number; +} + +declare var ClientRect: { + prototype: ClientRect; + new(): ClientRect; +} + +interface ClientRectList { + length: number; + item(index: number): ClientRect; + [index: number]: ClientRect; +} + +declare var ClientRectList: { + prototype: ClientRectList; + new(): ClientRectList; +} + +interface ClipboardEvent extends Event { + clipboardData: DataTransfer; +} + +declare var ClipboardEvent: { + prototype: ClipboardEvent; + new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; +} + +interface CloseEvent extends Event { + code: number; + reason: string; + wasClean: boolean; + initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; +} + +declare var CloseEvent: { + prototype: CloseEvent; + new(): CloseEvent; +} + +interface CommandEvent extends Event { + commandName: string; + detail: string; +} + +declare var CommandEvent: { + prototype: CommandEvent; + new(type: string, eventInitDict?: CommandEventInit): CommandEvent; +} + +interface Comment extends CharacterData { + text: string; +} + +declare var Comment: { + prototype: Comment; + new(): Comment; +} + +interface CompositionEvent extends UIEvent { + data: string; + locale: string; + initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; +} + +declare var CompositionEvent: { + prototype: CompositionEvent; + new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent; +} + +interface Console { + assert(test?: boolean, message?: string, ...optionalParams: any[]): void; + clear(): void; + count(countTitle?: string): void; + debug(message?: string, ...optionalParams: any[]): void; + dir(value?: any, ...optionalParams: any[]): void; + dirxml(value: any): void; + error(message?: any, ...optionalParams: any[]): void; + group(groupTitle?: string): void; + groupCollapsed(groupTitle?: string): void; + groupEnd(): void; + info(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + msIsIndependentlyComposed(element: Element): boolean; + profile(reportName?: string): void; + profileEnd(): void; + select(element: Element): void; + time(timerName?: string): void; + timeEnd(timerName?: string): void; + trace(): void; + warn(message?: any, ...optionalParams: any[]): void; +} + +declare var Console: { + prototype: Console; + new(): Console; +} + +interface ConvolverNode extends AudioNode { + buffer: AudioBuffer; + normalize: boolean; +} + +declare var ConvolverNode: { + prototype: ConvolverNode; + new(): ConvolverNode; +} + +interface Coordinates { + accuracy: number; + altitude: number; + altitudeAccuracy: number; + heading: number; + latitude: number; + longitude: number; + speed: number; +} + +declare var Coordinates: { + prototype: Coordinates; + new(): Coordinates; +} + +interface Crypto extends Object, RandomSource { + subtle: SubtleCrypto; +} + +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +} + +interface CryptoKey { + algorithm: KeyAlgorithm; + extractable: boolean; + type: string; + usages: string[]; +} + +declare var CryptoKey: { + prototype: CryptoKey; + new(): CryptoKey; +} + +interface CryptoKeyPair { + privateKey: CryptoKey; + publicKey: CryptoKey; +} + +declare var CryptoKeyPair: { + prototype: CryptoKeyPair; + new(): CryptoKeyPair; +} + +interface CustomEvent extends Event { + detail: any; + initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; +} + +declare var CustomEvent: { + prototype: CustomEvent; + new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent; +} + +interface DOMError { + name: string; + toString(): string; +} + +declare var DOMError: { + prototype: DOMError; + new(): DOMError; +} + +interface DOMException { + code: number; + message: string; + name: string; + toString(): string; + ABORT_ERR: number; + DATA_CLONE_ERR: number; + DOMSTRING_SIZE_ERR: number; + HIERARCHY_REQUEST_ERR: number; + INDEX_SIZE_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_ACCESS_ERR: number; + INVALID_CHARACTER_ERR: number; + INVALID_MODIFICATION_ERR: number; + INVALID_NODE_TYPE_ERR: number; + INVALID_STATE_ERR: number; + NAMESPACE_ERR: number; + NETWORK_ERR: number; + NOT_FOUND_ERR: number; + NOT_SUPPORTED_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + PARSE_ERR: number; + QUOTA_EXCEEDED_ERR: number; + SECURITY_ERR: number; + SERIALIZE_ERR: number; + SYNTAX_ERR: number; + TIMEOUT_ERR: number; + TYPE_MISMATCH_ERR: number; + URL_MISMATCH_ERR: number; + VALIDATION_ERR: number; + WRONG_DOCUMENT_ERR: number; +} + +declare var DOMException: { + prototype: DOMException; + new(): DOMException; + ABORT_ERR: number; + DATA_CLONE_ERR: number; + DOMSTRING_SIZE_ERR: number; + HIERARCHY_REQUEST_ERR: number; + INDEX_SIZE_ERR: number; + INUSE_ATTRIBUTE_ERR: number; + INVALID_ACCESS_ERR: number; + INVALID_CHARACTER_ERR: number; + INVALID_MODIFICATION_ERR: number; + INVALID_NODE_TYPE_ERR: number; + INVALID_STATE_ERR: number; + NAMESPACE_ERR: number; + NETWORK_ERR: number; + NOT_FOUND_ERR: number; + NOT_SUPPORTED_ERR: number; + NO_DATA_ALLOWED_ERR: number; + NO_MODIFICATION_ALLOWED_ERR: number; + PARSE_ERR: number; + QUOTA_EXCEEDED_ERR: number; + SECURITY_ERR: number; + SERIALIZE_ERR: number; + SYNTAX_ERR: number; + TIMEOUT_ERR: number; + TYPE_MISMATCH_ERR: number; + URL_MISMATCH_ERR: number; + VALIDATION_ERR: number; + WRONG_DOCUMENT_ERR: number; +} + +interface DOMImplementation { + createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + createHTMLDocument(title: string): Document; + hasFeature(feature: string, version: string): boolean; +} + +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +} + +interface DOMParser { + parseFromString(source: string, mimeType: string): Document; +} + +declare var DOMParser: { + prototype: DOMParser; + new(): DOMParser; +} + +interface DOMSettableTokenList extends DOMTokenList { + value: string; +} + +declare var DOMSettableTokenList: { + prototype: DOMSettableTokenList; + new(): DOMSettableTokenList; +} + +interface DOMStringList { + length: number; + contains(str: string): boolean; + item(index: number): string; + [index: number]: string; +} + +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +} + +interface DOMStringMap { + [name: string]: string; +} + +declare var DOMStringMap: { + prototype: DOMStringMap; + new(): DOMStringMap; +} + +interface DOMTokenList { + length: number; + add(...token: string[]): void; + contains(token: string): boolean; + item(index: number): string; + remove(...token: string[]): void; + toString(): string; + toggle(token: string, force?: boolean): boolean; + [index: number]: string; +} + +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +} + +interface DataCue extends TextTrackCue { + data: ArrayBuffer; +} + +declare var DataCue: { + prototype: DataCue; + new(): DataCue; +} + +interface DataTransfer { + dropEffect: string; + effectAllowed: string; + files: FileList; + items: DataTransferItemList; + types: DOMStringList; + clearData(format?: string): boolean; + getData(format: string): string; + setData(format: string, data: string): boolean; +} + +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +} + +interface DataTransferItem { + kind: string; + type: string; + getAsFile(): File; + getAsString(_callback: FunctionStringCallback): void; +} + +declare var DataTransferItem: { + prototype: DataTransferItem; + new(): DataTransferItem; +} + +interface DataTransferItemList { + length: number; + add(data: File): DataTransferItem; + clear(): void; + item(index: number): File; + remove(index: number): void; + [index: number]: File; +} + +declare var DataTransferItemList: { + prototype: DataTransferItemList; + new(): DataTransferItemList; +} + +interface DeferredPermissionRequest { + id: number; + type: string; + uri: string; + allow(): void; + deny(): void; +} + +declare var DeferredPermissionRequest: { + prototype: DeferredPermissionRequest; + new(): DeferredPermissionRequest; +} + +interface DelayNode extends AudioNode { + delayTime: AudioParam; +} + +declare var DelayNode: { + prototype: DelayNode; + new(): DelayNode; +} + +interface DeviceAcceleration { + x: number; + y: number; + z: number; +} + +declare var DeviceAcceleration: { + prototype: DeviceAcceleration; + new(): DeviceAcceleration; +} + +interface DeviceMotionEvent extends Event { + acceleration: DeviceAcceleration; + accelerationIncludingGravity: DeviceAcceleration; + interval: number; + rotationRate: DeviceRotationRate; + initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; +} + +declare var DeviceMotionEvent: { + prototype: DeviceMotionEvent; + new(): DeviceMotionEvent; +} + +interface DeviceOrientationEvent extends Event { + absolute: boolean; + alpha: number; + beta: number; + gamma: number; + initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; +} + +declare var DeviceOrientationEvent: { + prototype: DeviceOrientationEvent; + new(): DeviceOrientationEvent; +} + +interface DeviceRotationRate { + alpha: number; + beta: number; + gamma: number; +} + +declare var DeviceRotationRate: { + prototype: DeviceRotationRate; + new(): DeviceRotationRate; +} + +interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent { + /** + * Sets or gets the URL for the current document. + */ + URL: string; + /** + * Gets the URL for the document, stripped of any character encoding. + */ + URLUnencoded: string; + /** + * Gets the object that has the focus when the parent document has focus. + */ + activeElement: Element; + /** + * Sets or gets the color of all active links in the document. + */ + alinkColor: string; + /** + * Returns a reference to the collection of elements contained by the object. + */ + all: HTMLCollection; + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + */ + anchors: HTMLCollection; + /** + * Retrieves a collection of all applet objects in the document. + */ + applets: HTMLCollection; + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + */ + bgColor: string; + /** + * Specifies the beginning and end of the document body. + */ + body: HTMLElement; + characterSet: string; + /** + * Gets or sets the character set used to encode the object. + */ + charset: string; + /** + * Gets a value that indicates whether standards-compliant mode is switched on for the object. + */ + compatMode: string; + cookie: string; + /** + * Gets the default character set from the current regional language settings. + */ + defaultCharset: string; + defaultView: Window; + /** + * Sets or gets a value that indicates whether the document can be edited. + */ + designMode: string; + /** + * Sets or retrieves a value that indicates the reading order of the object. + */ + dir: string; + /** + * Gets an object representing the document type declaration associated with the current document. + */ + doctype: DocumentType; + /** + * Gets a reference to the root node of the document. + */ + documentElement: HTMLElement; + /** + * Sets or gets the security domain of the document. + */ + domain: string; + /** + * Retrieves a collection of all embed objects in the document. + */ + embeds: HTMLCollection; + /** + * Sets or gets the foreground (text) color of the document. + */ + fgColor: string; + /** + * Retrieves a collection, in source order, of all form objects in the document. + */ + forms: HTMLCollection; + fullscreenElement: Element; + fullscreenEnabled: boolean; + head: HTMLHeadElement; + hidden: boolean; + /** + * Retrieves a collection, in source order, of img objects in the document. + */ + images: HTMLCollection; + /** + * Gets the implementation object of the current document. + */ + implementation: DOMImplementation; + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. + */ + inputEncoding: string; + /** + * Gets the date that the page was last modified, if the page supplies one. + */ + lastModified: string; + /** + * Sets or gets the color of the document links. + */ + linkColor: string; + /** + * Retrieves a collection of all a objects that specify the href property and all area objects in the document. + */ + links: HTMLCollection; + /** + * Contains information about the current URL. + */ + location: Location; + media: string; + msCSSOMElementFloatMetrics: boolean; + msCapsLockWarningOff: boolean; + msHidden: boolean; + msVisibilityState: string; + /** + * Fires when the user aborts the download. + * @param ev The event. + */ + onabort: (ev: Event) => any; + /** + * Fires when the object is set as the active element. + * @param ev The event. + */ + onactivate: (ev: UIEvent) => any; + /** + * Fires immediately before the object is set as the active element. + * @param ev The event. + */ + onbeforeactivate: (ev: UIEvent) => any; + /** + * Fires immediately before the activeElement is changed from the current object to another object in the parent document. + * @param ev The event. + */ + onbeforedeactivate: (ev: UIEvent) => any; + /** + * Fires when the object loses the input focus. + * @param ev The focus event. + */ + onblur: (ev: FocusEvent) => any; + /** + * Occurs when playback is possible, but would require further buffering. + * @param ev The event. + */ + oncanplay: (ev: Event) => any; + oncanplaythrough: (ev: Event) => any; + /** + * Fires when the contents of the object or selection have changed. + * @param ev The event. + */ + onchange: (ev: Event) => any; + /** + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. + */ + onclick: (ev: MouseEvent) => any; + /** + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. + */ + oncontextmenu: (ev: PointerEvent) => any; + /** + * Fires when the user double-clicks the object. + * @param ev The mouse event. + */ + ondblclick: (ev: MouseEvent) => any; + /** + * Fires when the activeElement is changed from the current object to another object in the parent document. + * @param ev The UI Event + */ + ondeactivate: (ev: UIEvent) => any; + /** + * Fires on the source object continuously during a drag operation. + * @param ev The event. + */ + ondrag: (ev: DragEvent) => any; + /** + * Fires on the source object when the user releases the mouse at the close of a drag operation. + * @param ev The event. + */ + ondragend: (ev: DragEvent) => any; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + */ + ondragenter: (ev: DragEvent) => any; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + */ + ondragleave: (ev: DragEvent) => any; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + */ + ondragover: (ev: DragEvent) => any; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + */ + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + */ + ondurationchange: (ev: Event) => any; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + */ + onemptied: (ev: Event) => any; + /** + * Occurs when the end of playback is reached. + * @param ev The event + */ + onended: (ev: Event) => any; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + */ + onerror: (ev: Event) => any; + /** + * Fires when the object receives focus. + * @param ev The event. + */ + onfocus: (ev: FocusEvent) => any; + onfullscreenchange: (ev: Event) => any; + onfullscreenerror: (ev: Event) => any; + oninput: (ev: Event) => any; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + */ + onkeydown: (ev: KeyboardEvent) => any; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + */ + onkeypress: (ev: KeyboardEvent) => any; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + */ + onkeyup: (ev: KeyboardEvent) => any; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + */ + onload: (ev: Event) => any; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + */ + onloadeddata: (ev: Event) => any; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + */ + onloadedmetadata: (ev: Event) => any; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + */ + onloadstart: (ev: Event) => any; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + */ + onmousedown: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + */ + onmousemove: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + */ + onmouseout: (ev: MouseEvent) => any; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + */ + onmouseover: (ev: MouseEvent) => any; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + */ + onmouseup: (ev: MouseEvent) => any; + /** + * Fires when the wheel button is rotated. + * @param ev The mouse event + */ + onmousewheel: (ev: MouseWheelEvent) => any; + onmscontentzoom: (ev: UIEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + /** + * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. + * @param ev The event. + */ + onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; + /** + * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. + * @param ev The event. + */ + onmsthumbnailclick: (ev: MSSiteModeEvent) => any; + /** + * Occurs when playback is paused. + * @param ev The event. + */ + onpause: (ev: Event) => any; + /** + * Occurs when the play method is requested. + * @param ev The event. + */ + onplay: (ev: Event) => any; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + */ + onplaying: (ev: Event) => any; + onpointerlockchange: (ev: Event) => any; + onpointerlockerror: (ev: Event) => any; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + */ + onprogress: (ev: ProgressEvent) => any; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + */ + onratechange: (ev: Event) => any; + /** + * Fires when the state of the object has changed. + * @param ev The event + */ + onreadystatechange: (ev: ProgressEvent) => any; + /** + * Fires when the user resets a form. + * @param ev The event. + */ + onreset: (ev: Event) => any; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + */ + onscroll: (ev: UIEvent) => any; + /** + * Occurs when the seek operation ends. + * @param ev The event. + */ + onseeked: (ev: Event) => any; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + */ + onseeking: (ev: Event) => any; + /** + * Fires when the current selection changes. + * @param ev The event. + */ + onselect: (ev: UIEvent) => any; + onselectstart: (ev: Event) => any; + /** + * Occurs when the download has stopped. + * @param ev The event. + */ + onstalled: (ev: Event) => any; + /** + * Fires when the user clicks the Stop button or leaves the Web page. + * @param ev The event. + */ + onstop: (ev: Event) => any; + onsubmit: (ev: Event) => any; + /** + * Occurs if the load operation has been intentionally halted. + * @param ev The event. + */ + onsuspend: (ev: Event) => any; + /** + * Occurs to indicate the current playback position. + * @param ev The event. + */ + ontimeupdate: (ev: Event) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + */ + onvolumechange: (ev: Event) => any; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + */ + onwaiting: (ev: Event) => any; + onwebkitfullscreenchange: (ev: Event) => any; + onwebkitfullscreenerror: (ev: Event) => any; + plugins: HTMLCollection; + pointerLockElement: Element; + /** + * Retrieves a value that indicates the current state of the object. + */ + readyState: string; + /** + * Gets the URL of the location that referred the user to the current page. + */ + referrer: string; + /** + * Gets the root svg element in the document hierarchy. + */ + rootElement: SVGSVGElement; + /** + * Retrieves a collection of all script objects in the document. + */ + scripts: HTMLCollection; + security: string; + /** + * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. + */ + styleSheets: StyleSheetList; + /** + * Contains the title of the document. + */ + title: string; + visibilityState: string; + /** + * Sets or gets the color of the links that the user has visited. + */ + vlinkColor: string; + webkitCurrentFullScreenElement: Element; + webkitFullscreenElement: Element; + webkitFullscreenEnabled: boolean; + webkitIsFullScreen: boolean; + xmlEncoding: string; + xmlStandalone: boolean; + /** + * Gets or sets the version attribute specified in the declaration of an XML document. + */ + xmlVersion: string; + adoptNode(source: Node): Node; + captureEvents(): void; + clear(): void; + /** + * Closes an output stream and forces the sent data to display. + */ + close(): void; + /** + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. + */ + createAttribute(name: string): Attr; + createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; + createCDATASection(data: string): CDATASection; + /** + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. + */ + createComment(data: string): Comment; + /** + * Creates a new document. + */ + createDocumentFragment(): DocumentFragment; + /** + * Creates an instance of the element for the specified tag. + * @param tagName The name of an element. + */ + createElement(tagName: "a"): HTMLAnchorElement; + createElement(tagName: "abbr"): HTMLPhraseElement; + createElement(tagName: "acronym"): HTMLPhraseElement; + createElement(tagName: "address"): HTMLBlockElement; + createElement(tagName: "applet"): HTMLAppletElement; + createElement(tagName: "area"): HTMLAreaElement; + createElement(tagName: "audio"): HTMLAudioElement; + createElement(tagName: "b"): HTMLPhraseElement; + createElement(tagName: "base"): HTMLBaseElement; + createElement(tagName: "basefont"): HTMLBaseFontElement; + createElement(tagName: "bdo"): HTMLPhraseElement; + createElement(tagName: "big"): HTMLPhraseElement; + createElement(tagName: "blockquote"): HTMLBlockElement; + createElement(tagName: "body"): HTMLBodyElement; + createElement(tagName: "br"): HTMLBRElement; + createElement(tagName: "button"): HTMLButtonElement; + createElement(tagName: "canvas"): HTMLCanvasElement; + createElement(tagName: "caption"): HTMLTableCaptionElement; + createElement(tagName: "center"): HTMLBlockElement; + createElement(tagName: "cite"): HTMLPhraseElement; + createElement(tagName: "code"): HTMLPhraseElement; + createElement(tagName: "col"): HTMLTableColElement; + createElement(tagName: "colgroup"): HTMLTableColElement; + createElement(tagName: "datalist"): HTMLDataListElement; + createElement(tagName: "dd"): HTMLDDElement; + createElement(tagName: "del"): HTMLModElement; + createElement(tagName: "dfn"): HTMLPhraseElement; + createElement(tagName: "dir"): HTMLDirectoryElement; + createElement(tagName: "div"): HTMLDivElement; + createElement(tagName: "dl"): HTMLDListElement; + createElement(tagName: "dt"): HTMLDTElement; + createElement(tagName: "em"): HTMLPhraseElement; + createElement(tagName: "embed"): HTMLEmbedElement; + createElement(tagName: "fieldset"): HTMLFieldSetElement; + createElement(tagName: "font"): HTMLFontElement; + createElement(tagName: "form"): HTMLFormElement; + createElement(tagName: "frame"): HTMLFrameElement; + createElement(tagName: "frameset"): HTMLFrameSetElement; + createElement(tagName: "h1"): HTMLHeadingElement; + createElement(tagName: "h2"): HTMLHeadingElement; + createElement(tagName: "h3"): HTMLHeadingElement; + createElement(tagName: "h4"): HTMLHeadingElement; + createElement(tagName: "h5"): HTMLHeadingElement; + createElement(tagName: "h6"): HTMLHeadingElement; + createElement(tagName: "head"): HTMLHeadElement; + createElement(tagName: "hr"): HTMLHRElement; + createElement(tagName: "html"): HTMLHtmlElement; + createElement(tagName: "i"): HTMLPhraseElement; + createElement(tagName: "iframe"): HTMLIFrameElement; + createElement(tagName: "img"): HTMLImageElement; + createElement(tagName: "input"): HTMLInputElement; + createElement(tagName: "ins"): HTMLModElement; + createElement(tagName: "isindex"): HTMLIsIndexElement; + createElement(tagName: "kbd"): HTMLPhraseElement; + createElement(tagName: "keygen"): HTMLBlockElement; + createElement(tagName: "label"): HTMLLabelElement; + createElement(tagName: "legend"): HTMLLegendElement; + createElement(tagName: "li"): HTMLLIElement; + createElement(tagName: "link"): HTMLLinkElement; + createElement(tagName: "listing"): HTMLBlockElement; + createElement(tagName: "map"): HTMLMapElement; + createElement(tagName: "marquee"): HTMLMarqueeElement; + createElement(tagName: "menu"): HTMLMenuElement; + createElement(tagName: "meta"): HTMLMetaElement; + createElement(tagName: "nextid"): HTMLNextIdElement; + createElement(tagName: "nobr"): HTMLPhraseElement; + createElement(tagName: "object"): HTMLObjectElement; + createElement(tagName: "ol"): HTMLOListElement; + createElement(tagName: "optgroup"): HTMLOptGroupElement; + createElement(tagName: "option"): HTMLOptionElement; + createElement(tagName: "p"): HTMLParagraphElement; + createElement(tagName: "param"): HTMLParamElement; + createElement(tagName: "plaintext"): HTMLBlockElement; + createElement(tagName: "pre"): HTMLPreElement; + createElement(tagName: "progress"): HTMLProgressElement; + createElement(tagName: "q"): HTMLQuoteElement; + createElement(tagName: "rt"): HTMLPhraseElement; + createElement(tagName: "ruby"): HTMLPhraseElement; + createElement(tagName: "s"): HTMLPhraseElement; + createElement(tagName: "samp"): HTMLPhraseElement; + createElement(tagName: "script"): HTMLScriptElement; + createElement(tagName: "select"): HTMLSelectElement; + createElement(tagName: "small"): HTMLPhraseElement; + createElement(tagName: "source"): HTMLSourceElement; + createElement(tagName: "span"): HTMLSpanElement; + createElement(tagName: "strike"): HTMLPhraseElement; + createElement(tagName: "strong"): HTMLPhraseElement; + createElement(tagName: "style"): HTMLStyleElement; + createElement(tagName: "sub"): HTMLPhraseElement; + createElement(tagName: "sup"): HTMLPhraseElement; + createElement(tagName: "table"): HTMLTableElement; + createElement(tagName: "tbody"): HTMLTableSectionElement; + createElement(tagName: "td"): HTMLTableDataCellElement; + createElement(tagName: "textarea"): HTMLTextAreaElement; + createElement(tagName: "tfoot"): HTMLTableSectionElement; + createElement(tagName: "th"): HTMLTableHeaderCellElement; + createElement(tagName: "thead"): HTMLTableSectionElement; + createElement(tagName: "title"): HTMLTitleElement; + createElement(tagName: "tr"): HTMLTableRowElement; + createElement(tagName: "track"): HTMLTrackElement; + createElement(tagName: "tt"): HTMLPhraseElement; + createElement(tagName: "u"): HTMLPhraseElement; + createElement(tagName: "ul"): HTMLUListElement; + createElement(tagName: "var"): HTMLPhraseElement; + createElement(tagName: "video"): HTMLVideoElement; + createElement(tagName: "x-ms-webview"): MSHTMLWebViewElement; + createElement(tagName: "xmp"): HTMLBlockElement; + createElement(tagName: string): HTMLElement; + createElementNS(namespaceURI: string, qualifiedName: string): Element; + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver: Node): XPathNSResolver; + /** + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator; + createProcessingInstruction(target: string, data: string): ProcessingInstruction; + /** + * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. + */ + createRange(): Range; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + */ + createTextNode(data: string): Text; + createTouch(view: any, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch; + createTouchList(...touches: Touch[]): TouchList; + /** + * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. + * @param filter A custom NodeFilter function to use. + * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. + */ + createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + */ + execCommand(commandId: string, showUI?: boolean, value?: any): boolean; + /** + * Displays help information for the given command identifier. + * @param commandId Displays help information for the given command identifier. + */ + execCommandShowHelp(commandId: string): boolean; + exitFullscreen(): void; + exitPointerLock(): void; + /** + * Causes the element to receive the focus and executes the code specified by the onfocus event. + */ + focus(): void; + /** + * Returns a reference to the first object with the specified value of the ID or NAME attribute. + * @param elementId String that specifies the ID value. Case-insensitive. + */ + getElementById(elementId: string): HTMLElement; + getElementsByClassName(classNames: string): NodeList; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + */ + getElementsByName(elementName: string): NodeList; + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + */ + getElementsByTagName(tagname: "a"): NodeListOf; + getElementsByTagName(tagname: "abbr"): NodeListOf; + getElementsByTagName(tagname: "acronym"): NodeListOf; + getElementsByTagName(tagname: "address"): NodeListOf; + getElementsByTagName(tagname: "applet"): NodeListOf; + getElementsByTagName(tagname: "area"): NodeListOf; + getElementsByTagName(tagname: "article"): NodeListOf; + getElementsByTagName(tagname: "aside"): NodeListOf; + getElementsByTagName(tagname: "audio"): NodeListOf; + getElementsByTagName(tagname: "b"): NodeListOf; + getElementsByTagName(tagname: "base"): NodeListOf; + getElementsByTagName(tagname: "basefont"): NodeListOf; + getElementsByTagName(tagname: "bdo"): NodeListOf; + getElementsByTagName(tagname: "big"): NodeListOf; + getElementsByTagName(tagname: "blockquote"): NodeListOf; + getElementsByTagName(tagname: "body"): NodeListOf; + getElementsByTagName(tagname: "br"): NodeListOf; + getElementsByTagName(tagname: "button"): NodeListOf; + getElementsByTagName(tagname: "canvas"): NodeListOf; + getElementsByTagName(tagname: "caption"): NodeListOf; + getElementsByTagName(tagname: "center"): NodeListOf; + getElementsByTagName(tagname: "circle"): NodeListOf; + getElementsByTagName(tagname: "cite"): NodeListOf; + getElementsByTagName(tagname: "clippath"): NodeListOf; + getElementsByTagName(tagname: "code"): NodeListOf; + getElementsByTagName(tagname: "col"): NodeListOf; + getElementsByTagName(tagname: "colgroup"): NodeListOf; + getElementsByTagName(tagname: "datalist"): NodeListOf; + getElementsByTagName(tagname: "dd"): NodeListOf; + getElementsByTagName(tagname: "defs"): NodeListOf; + getElementsByTagName(tagname: "del"): NodeListOf; + getElementsByTagName(tagname: "desc"): NodeListOf; + getElementsByTagName(tagname: "dfn"): NodeListOf; + getElementsByTagName(tagname: "dir"): NodeListOf; + getElementsByTagName(tagname: "div"): NodeListOf; + getElementsByTagName(tagname: "dl"): NodeListOf; + getElementsByTagName(tagname: "dt"): NodeListOf; + getElementsByTagName(tagname: "ellipse"): NodeListOf; + getElementsByTagName(tagname: "em"): NodeListOf; + getElementsByTagName(tagname: "embed"): NodeListOf; + getElementsByTagName(tagname: "feblend"): NodeListOf; + getElementsByTagName(tagname: "fecolormatrix"): NodeListOf; + getElementsByTagName(tagname: "fecomponenttransfer"): NodeListOf; + getElementsByTagName(tagname: "fecomposite"): NodeListOf; + getElementsByTagName(tagname: "feconvolvematrix"): NodeListOf; + getElementsByTagName(tagname: "fediffuselighting"): NodeListOf; + getElementsByTagName(tagname: "fedisplacementmap"): NodeListOf; + getElementsByTagName(tagname: "fedistantlight"): NodeListOf; + getElementsByTagName(tagname: "feflood"): NodeListOf; + getElementsByTagName(tagname: "fefunca"): NodeListOf; + getElementsByTagName(tagname: "fefuncb"): NodeListOf; + getElementsByTagName(tagname: "fefuncg"): NodeListOf; + getElementsByTagName(tagname: "fefuncr"): NodeListOf; + getElementsByTagName(tagname: "fegaussianblur"): NodeListOf; + getElementsByTagName(tagname: "feimage"): NodeListOf; + getElementsByTagName(tagname: "femerge"): NodeListOf; + getElementsByTagName(tagname: "femergenode"): NodeListOf; + getElementsByTagName(tagname: "femorphology"): NodeListOf; + getElementsByTagName(tagname: "feoffset"): NodeListOf; + getElementsByTagName(tagname: "fepointlight"): NodeListOf; + getElementsByTagName(tagname: "fespecularlighting"): NodeListOf; + getElementsByTagName(tagname: "fespotlight"): NodeListOf; + getElementsByTagName(tagname: "fetile"): NodeListOf; + getElementsByTagName(tagname: "feturbulence"): NodeListOf; + getElementsByTagName(tagname: "fieldset"): NodeListOf; + getElementsByTagName(tagname: "figcaption"): NodeListOf; + getElementsByTagName(tagname: "figure"): NodeListOf; + getElementsByTagName(tagname: "filter"): NodeListOf; + getElementsByTagName(tagname: "font"): NodeListOf; + getElementsByTagName(tagname: "footer"): NodeListOf; + getElementsByTagName(tagname: "foreignobject"): NodeListOf; + getElementsByTagName(tagname: "form"): NodeListOf; + getElementsByTagName(tagname: "frame"): NodeListOf; + getElementsByTagName(tagname: "frameset"): NodeListOf; + getElementsByTagName(tagname: "g"): NodeListOf; + getElementsByTagName(tagname: "h1"): NodeListOf; + getElementsByTagName(tagname: "h2"): NodeListOf; + getElementsByTagName(tagname: "h3"): NodeListOf; + getElementsByTagName(tagname: "h4"): NodeListOf; + getElementsByTagName(tagname: "h5"): NodeListOf; + getElementsByTagName(tagname: "h6"): NodeListOf; + getElementsByTagName(tagname: "head"): NodeListOf; + getElementsByTagName(tagname: "header"): NodeListOf; + getElementsByTagName(tagname: "hgroup"): NodeListOf; + getElementsByTagName(tagname: "hr"): NodeListOf; + getElementsByTagName(tagname: "html"): NodeListOf; + getElementsByTagName(tagname: "i"): NodeListOf; + getElementsByTagName(tagname: "iframe"): NodeListOf; + getElementsByTagName(tagname: "image"): NodeListOf; + getElementsByTagName(tagname: "img"): NodeListOf; + getElementsByTagName(tagname: "input"): NodeListOf; + getElementsByTagName(tagname: "ins"): NodeListOf; + getElementsByTagName(tagname: "isindex"): NodeListOf; + getElementsByTagName(tagname: "kbd"): NodeListOf; + getElementsByTagName(tagname: "keygen"): NodeListOf; + getElementsByTagName(tagname: "label"): NodeListOf; + getElementsByTagName(tagname: "legend"): NodeListOf; + getElementsByTagName(tagname: "li"): NodeListOf; + getElementsByTagName(tagname: "line"): NodeListOf; + getElementsByTagName(tagname: "lineargradient"): NodeListOf; + getElementsByTagName(tagname: "link"): NodeListOf; + getElementsByTagName(tagname: "listing"): NodeListOf; + getElementsByTagName(tagname: "map"): NodeListOf; + getElementsByTagName(tagname: "mark"): NodeListOf; + getElementsByTagName(tagname: "marker"): NodeListOf; + getElementsByTagName(tagname: "marquee"): NodeListOf; + getElementsByTagName(tagname: "mask"): NodeListOf; + getElementsByTagName(tagname: "menu"): NodeListOf; + getElementsByTagName(tagname: "meta"): NodeListOf; + getElementsByTagName(tagname: "metadata"): NodeListOf; + getElementsByTagName(tagname: "nav"): NodeListOf; + getElementsByTagName(tagname: "nextid"): NodeListOf; + getElementsByTagName(tagname: "nobr"): NodeListOf; + getElementsByTagName(tagname: "noframes"): NodeListOf; + getElementsByTagName(tagname: "noscript"): NodeListOf; + getElementsByTagName(tagname: "object"): NodeListOf; + getElementsByTagName(tagname: "ol"): NodeListOf; + getElementsByTagName(tagname: "optgroup"): NodeListOf; + getElementsByTagName(tagname: "option"): NodeListOf; + getElementsByTagName(tagname: "p"): NodeListOf; + getElementsByTagName(tagname: "param"): NodeListOf; + getElementsByTagName(tagname: "path"): NodeListOf; + getElementsByTagName(tagname: "pattern"): NodeListOf; + getElementsByTagName(tagname: "plaintext"): NodeListOf; + getElementsByTagName(tagname: "polygon"): NodeListOf; + getElementsByTagName(tagname: "polyline"): NodeListOf; + getElementsByTagName(tagname: "pre"): NodeListOf; + getElementsByTagName(tagname: "progress"): NodeListOf; + getElementsByTagName(tagname: "q"): NodeListOf; + getElementsByTagName(tagname: "radialgradient"): NodeListOf; + getElementsByTagName(tagname: "rect"): NodeListOf; + getElementsByTagName(tagname: "rt"): NodeListOf; + getElementsByTagName(tagname: "ruby"): NodeListOf; + getElementsByTagName(tagname: "s"): NodeListOf; + getElementsByTagName(tagname: "samp"): NodeListOf; + getElementsByTagName(tagname: "script"): NodeListOf; + getElementsByTagName(tagname: "section"): NodeListOf; + getElementsByTagName(tagname: "select"): NodeListOf; + getElementsByTagName(tagname: "small"): NodeListOf; + getElementsByTagName(tagname: "source"): NodeListOf; + getElementsByTagName(tagname: "span"): NodeListOf; + getElementsByTagName(tagname: "stop"): NodeListOf; + getElementsByTagName(tagname: "strike"): NodeListOf; + getElementsByTagName(tagname: "strong"): NodeListOf; + getElementsByTagName(tagname: "style"): NodeListOf; + getElementsByTagName(tagname: "sub"): NodeListOf; + getElementsByTagName(tagname: "sup"): NodeListOf; + getElementsByTagName(tagname: "svg"): NodeListOf; + getElementsByTagName(tagname: "switch"): NodeListOf; + getElementsByTagName(tagname: "symbol"): NodeListOf; + getElementsByTagName(tagname: "table"): NodeListOf; + getElementsByTagName(tagname: "tbody"): NodeListOf; + getElementsByTagName(tagname: "td"): NodeListOf; + getElementsByTagName(tagname: "text"): NodeListOf; + getElementsByTagName(tagname: "textpath"): NodeListOf; + getElementsByTagName(tagname: "textarea"): NodeListOf; + getElementsByTagName(tagname: "tfoot"): NodeListOf; + getElementsByTagName(tagname: "th"): NodeListOf; + getElementsByTagName(tagname: "thead"): NodeListOf; + getElementsByTagName(tagname: "title"): NodeListOf; + getElementsByTagName(tagname: "tr"): NodeListOf; + getElementsByTagName(tagname: "track"): NodeListOf; + getElementsByTagName(tagname: "tspan"): NodeListOf; + getElementsByTagName(tagname: "tt"): NodeListOf; + getElementsByTagName(tagname: "u"): NodeListOf; + getElementsByTagName(tagname: "ul"): NodeListOf; + getElementsByTagName(tagname: "use"): NodeListOf; + getElementsByTagName(tagname: "var"): NodeListOf; + getElementsByTagName(tagname: "video"): NodeListOf; + getElementsByTagName(tagname: "view"): NodeListOf; + getElementsByTagName(tagname: "wbr"): NodeListOf; + getElementsByTagName(tagname: "x-ms-webview"): NodeListOf; + getElementsByTagName(tagname: "xmp"): NodeListOf; + getElementsByTagName(tagname: string): NodeList; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + /** + * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. + */ + getSelection(): Selection; + /** + * Gets a value indicating whether the object currently has focus. + */ + hasFocus(): boolean; + importNode(importedNode: Node, deep: boolean): Node; + msElementsFromPoint(x: number, y: number): NodeList; + msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; + msGetPrintDocumentForNamedFlow(flowName: string): Document; + msSetPrintDocumentUriForNamedFlow(flowName: string, uri: string): void; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + */ + open(url?: string, name?: string, features?: string, replace?: boolean): Document | Window; + /** + * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. + * @param commandId Specifies a command identifier. + */ + queryCommandEnabled(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. + */ + queryCommandIndeterm(commandId: string): boolean; + /** + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. + */ + queryCommandState(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. + */ + queryCommandSupported(commandId: string): boolean; + /** + * Retrieves the string associated with a command. + * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. + */ + queryCommandText(commandId: string): string; + /** + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. + */ + queryCommandValue(commandId: string): string; + releaseEvents(): void; + /** + * Allows updating the print settings for the page. + */ + updateSettings(): void; + webkitCancelFullScreen(): void; + webkitExitFullscreen(): void; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + */ + write(...content: string[]): void; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + */ + writeln(...content: string[]): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "fullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "fullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerlockchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointerlockerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Document: { + prototype: Document; + new(): Document; +} + +interface DocumentFragment extends Node, NodeSelector { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +} + +interface DocumentType extends Node, ChildNode { + entities: NamedNodeMap; + internalSubset: string; + name: string; + notations: NamedNodeMap; + publicId: string; + systemId: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +} + +interface DragEvent extends MouseEvent { + dataTransfer: DataTransfer; + initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; + msConvertURL(file: File, targetType: string, targetURL?: string): void; +} + +declare var DragEvent: { + prototype: DragEvent; + new(): DragEvent; +} + +interface DynamicsCompressorNode extends AudioNode { + attack: AudioParam; + knee: AudioParam; + ratio: AudioParam; + reduction: AudioParam; + release: AudioParam; + threshold: AudioParam; +} + +declare var DynamicsCompressorNode: { + prototype: DynamicsCompressorNode; + new(): DynamicsCompressorNode; +} + +interface EXT_texture_filter_anisotropic { + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +declare var EXT_texture_filter_anisotropic: { + prototype: EXT_texture_filter_anisotropic; + new(): EXT_texture_filter_anisotropic; + MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; + TEXTURE_MAX_ANISOTROPY_EXT: number; +} + +interface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode { + classList: DOMTokenList; + clientHeight: number; + clientLeft: number; + clientTop: number; + clientWidth: number; + msContentZoomFactor: number; + msRegionOverflow: string; + onariarequest: (ev: AriaRequestEvent) => any; + oncommand: (ev: CommandEvent) => any; + ongotpointercapture: (ev: PointerEvent) => any; + onlostpointercapture: (ev: PointerEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsgotpointercapture: (ev: MSPointerEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmslostpointercapture: (ev: MSPointerEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + ontouchcancel: (ev: TouchEvent) => any; + ontouchend: (ev: TouchEvent) => any; + ontouchmove: (ev: TouchEvent) => any; + ontouchstart: (ev: TouchEvent) => any; + onwebkitfullscreenchange: (ev: Event) => any; + onwebkitfullscreenerror: (ev: Event) => any; + scrollHeight: number; + scrollLeft: number; + scrollTop: number; + scrollWidth: number; + tagName: string; + getAttribute(name?: string): string; + getAttributeNS(namespaceURI: string, localName: string): string; + getAttributeNode(name: string): Attr; + getAttributeNodeNS(namespaceURI: string, localName: string): Attr; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + getElementsByTagName(name: "a"): NodeListOf; + getElementsByTagName(name: "abbr"): NodeListOf; + getElementsByTagName(name: "acronym"): NodeListOf; + getElementsByTagName(name: "address"): NodeListOf; + getElementsByTagName(name: "applet"): NodeListOf; + getElementsByTagName(name: "area"): NodeListOf; + getElementsByTagName(name: "article"): NodeListOf; + getElementsByTagName(name: "aside"): NodeListOf; + getElementsByTagName(name: "audio"): NodeListOf; + getElementsByTagName(name: "b"): NodeListOf; + getElementsByTagName(name: "base"): NodeListOf; + getElementsByTagName(name: "basefont"): NodeListOf; + getElementsByTagName(name: "bdo"): NodeListOf; + getElementsByTagName(name: "big"): NodeListOf; + getElementsByTagName(name: "blockquote"): NodeListOf; + getElementsByTagName(name: "body"): NodeListOf; + getElementsByTagName(name: "br"): NodeListOf; + getElementsByTagName(name: "button"): NodeListOf; + getElementsByTagName(name: "canvas"): NodeListOf; + getElementsByTagName(name: "caption"): NodeListOf; + getElementsByTagName(name: "center"): NodeListOf; + getElementsByTagName(name: "circle"): NodeListOf; + getElementsByTagName(name: "cite"): NodeListOf; + getElementsByTagName(name: "clippath"): NodeListOf; + getElementsByTagName(name: "code"): NodeListOf; + getElementsByTagName(name: "col"): NodeListOf; + getElementsByTagName(name: "colgroup"): NodeListOf; + getElementsByTagName(name: "datalist"): NodeListOf; + getElementsByTagName(name: "dd"): NodeListOf; + getElementsByTagName(name: "defs"): NodeListOf; + getElementsByTagName(name: "del"): NodeListOf; + getElementsByTagName(name: "desc"): NodeListOf; + getElementsByTagName(name: "dfn"): NodeListOf; + getElementsByTagName(name: "dir"): NodeListOf; + getElementsByTagName(name: "div"): NodeListOf; + getElementsByTagName(name: "dl"): NodeListOf; + getElementsByTagName(name: "dt"): NodeListOf; + getElementsByTagName(name: "ellipse"): NodeListOf; + getElementsByTagName(name: "em"): NodeListOf; + getElementsByTagName(name: "embed"): NodeListOf; + getElementsByTagName(name: "feblend"): NodeListOf; + getElementsByTagName(name: "fecolormatrix"): NodeListOf; + getElementsByTagName(name: "fecomponenttransfer"): NodeListOf; + getElementsByTagName(name: "fecomposite"): NodeListOf; + getElementsByTagName(name: "feconvolvematrix"): NodeListOf; + getElementsByTagName(name: "fediffuselighting"): NodeListOf; + getElementsByTagName(name: "fedisplacementmap"): NodeListOf; + getElementsByTagName(name: "fedistantlight"): NodeListOf; + getElementsByTagName(name: "feflood"): NodeListOf; + getElementsByTagName(name: "fefunca"): NodeListOf; + getElementsByTagName(name: "fefuncb"): NodeListOf; + getElementsByTagName(name: "fefuncg"): NodeListOf; + getElementsByTagName(name: "fefuncr"): NodeListOf; + getElementsByTagName(name: "fegaussianblur"): NodeListOf; + getElementsByTagName(name: "feimage"): NodeListOf; + getElementsByTagName(name: "femerge"): NodeListOf; + getElementsByTagName(name: "femergenode"): NodeListOf; + getElementsByTagName(name: "femorphology"): NodeListOf; + getElementsByTagName(name: "feoffset"): NodeListOf; + getElementsByTagName(name: "fepointlight"): NodeListOf; + getElementsByTagName(name: "fespecularlighting"): NodeListOf; + getElementsByTagName(name: "fespotlight"): NodeListOf; + getElementsByTagName(name: "fetile"): NodeListOf; + getElementsByTagName(name: "feturbulence"): NodeListOf; + getElementsByTagName(name: "fieldset"): NodeListOf; + getElementsByTagName(name: "figcaption"): NodeListOf; + getElementsByTagName(name: "figure"): NodeListOf; + getElementsByTagName(name: "filter"): NodeListOf; + getElementsByTagName(name: "font"): NodeListOf; + getElementsByTagName(name: "footer"): NodeListOf; + getElementsByTagName(name: "foreignobject"): NodeListOf; + getElementsByTagName(name: "form"): NodeListOf; + getElementsByTagName(name: "frame"): NodeListOf; + getElementsByTagName(name: "frameset"): NodeListOf; + getElementsByTagName(name: "g"): NodeListOf; + getElementsByTagName(name: "h1"): NodeListOf; + getElementsByTagName(name: "h2"): NodeListOf; + getElementsByTagName(name: "h3"): NodeListOf; + getElementsByTagName(name: "h4"): NodeListOf; + getElementsByTagName(name: "h5"): NodeListOf; + getElementsByTagName(name: "h6"): NodeListOf; + getElementsByTagName(name: "head"): NodeListOf; + getElementsByTagName(name: "header"): NodeListOf; + getElementsByTagName(name: "hgroup"): NodeListOf; + getElementsByTagName(name: "hr"): NodeListOf; + getElementsByTagName(name: "html"): NodeListOf; + getElementsByTagName(name: "i"): NodeListOf; + getElementsByTagName(name: "iframe"): NodeListOf; + getElementsByTagName(name: "image"): NodeListOf; + getElementsByTagName(name: "img"): NodeListOf; + getElementsByTagName(name: "input"): NodeListOf; + getElementsByTagName(name: "ins"): NodeListOf; + getElementsByTagName(name: "isindex"): NodeListOf; + getElementsByTagName(name: "kbd"): NodeListOf; + getElementsByTagName(name: "keygen"): NodeListOf; + getElementsByTagName(name: "label"): NodeListOf; + getElementsByTagName(name: "legend"): NodeListOf; + getElementsByTagName(name: "li"): NodeListOf; + getElementsByTagName(name: "line"): NodeListOf; + getElementsByTagName(name: "lineargradient"): NodeListOf; + getElementsByTagName(name: "link"): NodeListOf; + getElementsByTagName(name: "listing"): NodeListOf; + getElementsByTagName(name: "map"): NodeListOf; + getElementsByTagName(name: "mark"): NodeListOf; + getElementsByTagName(name: "marker"): NodeListOf; + getElementsByTagName(name: "marquee"): NodeListOf; + getElementsByTagName(name: "mask"): NodeListOf; + getElementsByTagName(name: "menu"): NodeListOf; + getElementsByTagName(name: "meta"): NodeListOf; + getElementsByTagName(name: "metadata"): NodeListOf; + getElementsByTagName(name: "nav"): NodeListOf; + getElementsByTagName(name: "nextid"): NodeListOf; + getElementsByTagName(name: "nobr"): NodeListOf; + getElementsByTagName(name: "noframes"): NodeListOf; + getElementsByTagName(name: "noscript"): NodeListOf; + getElementsByTagName(name: "object"): NodeListOf; + getElementsByTagName(name: "ol"): NodeListOf; + getElementsByTagName(name: "optgroup"): NodeListOf; + getElementsByTagName(name: "option"): NodeListOf; + getElementsByTagName(name: "p"): NodeListOf; + getElementsByTagName(name: "param"): NodeListOf; + getElementsByTagName(name: "path"): NodeListOf; + getElementsByTagName(name: "pattern"): NodeListOf; + getElementsByTagName(name: "plaintext"): NodeListOf; + getElementsByTagName(name: "polygon"): NodeListOf; + getElementsByTagName(name: "polyline"): NodeListOf; + getElementsByTagName(name: "pre"): NodeListOf; + getElementsByTagName(name: "progress"): NodeListOf; + getElementsByTagName(name: "q"): NodeListOf; + getElementsByTagName(name: "radialgradient"): NodeListOf; + getElementsByTagName(name: "rect"): NodeListOf; + getElementsByTagName(name: "rt"): NodeListOf; + getElementsByTagName(name: "ruby"): NodeListOf; + getElementsByTagName(name: "s"): NodeListOf; + getElementsByTagName(name: "samp"): NodeListOf; + getElementsByTagName(name: "script"): NodeListOf; + getElementsByTagName(name: "section"): NodeListOf; + getElementsByTagName(name: "select"): NodeListOf; + getElementsByTagName(name: "small"): NodeListOf; + getElementsByTagName(name: "source"): NodeListOf; + getElementsByTagName(name: "span"): NodeListOf; + getElementsByTagName(name: "stop"): NodeListOf; + getElementsByTagName(name: "strike"): NodeListOf; + getElementsByTagName(name: "strong"): NodeListOf; + getElementsByTagName(name: "style"): NodeListOf; + getElementsByTagName(name: "sub"): NodeListOf; + getElementsByTagName(name: "sup"): NodeListOf; + getElementsByTagName(name: "svg"): NodeListOf; + getElementsByTagName(name: "switch"): NodeListOf; + getElementsByTagName(name: "symbol"): NodeListOf; + getElementsByTagName(name: "table"): NodeListOf; + getElementsByTagName(name: "tbody"): NodeListOf; + getElementsByTagName(name: "td"): NodeListOf; + getElementsByTagName(name: "text"): NodeListOf; + getElementsByTagName(name: "textpath"): NodeListOf; + getElementsByTagName(name: "textarea"): NodeListOf; + getElementsByTagName(name: "tfoot"): NodeListOf; + getElementsByTagName(name: "th"): NodeListOf; + getElementsByTagName(name: "thead"): NodeListOf; + getElementsByTagName(name: "title"): NodeListOf; + getElementsByTagName(name: "tr"): NodeListOf; + getElementsByTagName(name: "track"): NodeListOf; + getElementsByTagName(name: "tspan"): NodeListOf; + getElementsByTagName(name: "tt"): NodeListOf; + getElementsByTagName(name: "u"): NodeListOf; + getElementsByTagName(name: "ul"): NodeListOf; + getElementsByTagName(name: "use"): NodeListOf; + getElementsByTagName(name: "var"): NodeListOf; + getElementsByTagName(name: "video"): NodeListOf; + getElementsByTagName(name: "view"): NodeListOf; + getElementsByTagName(name: "wbr"): NodeListOf; + getElementsByTagName(name: "x-ms-webview"): NodeListOf; + getElementsByTagName(name: "xmp"): NodeListOf; + getElementsByTagName(name: string): NodeList; + getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; + hasAttribute(name: string): boolean; + hasAttributeNS(namespaceURI: string, localName: string): boolean; + msGetRegionContent(): MSRangeCollection; + msGetUntransformedBounds(): ClientRect; + msMatchesSelector(selectors: string): boolean; + msReleasePointerCapture(pointerId: number): void; + msSetPointerCapture(pointerId: number): void; + msZoomTo(args: MsZoomToOptions): void; + releasePointerCapture(pointerId: number): void; + removeAttribute(name?: string): void; + removeAttributeNS(namespaceURI: string, localName: string): void; + removeAttributeNode(oldAttr: Attr): Attr; + requestFullscreen(): void; + requestPointerLock(): void; + setAttribute(name?: string, value?: string): void; + setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; + setAttributeNode(newAttr: Attr): Attr; + setAttributeNodeNS(newAttr: Attr): Attr; + setPointerCapture(pointerId: number): void; + webkitMatchesSelector(selectors: string): boolean; + webkitRequestFullScreen(): void; + webkitRequestFullscreen(): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Element: { + prototype: Element; + new(): Element; +} + +interface ErrorEvent extends Event { + colno: number; + error: any; + filename: string; + lineno: number; + message: string; + initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; +} + +declare var ErrorEvent: { + prototype: ErrorEvent; + new(): ErrorEvent; +} + +interface Event { + bubbles: boolean; + cancelBubble: boolean; + cancelable: boolean; + currentTarget: EventTarget; + defaultPrevented: boolean; + eventPhase: number; + isTrusted: boolean; + returnValue: boolean; + srcElement: Element; + target: EventTarget; + timeStamp: number; + type: string; + initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; + preventDefault(): void; + stopImmediatePropagation(): void; + stopPropagation(): void; + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; +} + +declare var Event: { + prototype: Event; + new(type: string, eventInitDict?: EventInit): Event; + AT_TARGET: number; + BUBBLING_PHASE: number; + CAPTURING_PHASE: number; +} + +interface EventTarget { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + dispatchEvent(evt: Event): boolean; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var EventTarget: { + prototype: EventTarget; + new(): EventTarget; +} + +interface External { +} + +declare var External: { + prototype: External; + new(): External; +} + +interface File extends Blob { + lastModifiedDate: any; + name: string; +} + +declare var File: { + prototype: File; + new(): File; +} + +interface FileList { + length: number; + item(index: number): File; + [index: number]: File; +} + +declare var FileList: { + prototype: FileList; + new(): FileList; +} + +interface FileReader extends EventTarget, MSBaseReader { + error: DOMError; + readAsArrayBuffer(blob: Blob): void; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var FileReader: { + prototype: FileReader; + new(): FileReader; +} + +interface FocusEvent extends UIEvent { + relatedTarget: EventTarget; + initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; +} + +declare var FocusEvent: { + prototype: FocusEvent; + new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent; +} + +interface FormData { + append(name: any, value: any, blobName?: string): void; +} + +declare var FormData: { + prototype: FormData; + new(): FormData; +} + +interface GainNode extends AudioNode { + gain: AudioParam; +} + +declare var GainNode: { + prototype: GainNode; + new(): GainNode; +} + +interface Gamepad { + axes: number[]; + buttons: GamepadButton[]; + connected: boolean; + id: string; + index: number; + mapping: string; + timestamp: number; +} + +declare var Gamepad: { + prototype: Gamepad; + new(): Gamepad; +} + +interface GamepadButton { + pressed: boolean; + value: number; +} + +declare var GamepadButton: { + prototype: GamepadButton; + new(): GamepadButton; +} + +interface GamepadEvent extends Event { + gamepad: Gamepad; +} + +declare var GamepadEvent: { + prototype: GamepadEvent; + new(): GamepadEvent; +} + +interface Geolocation { + clearWatch(watchId: number): void; + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; +} + +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +} + +interface HTMLAllCollection extends HTMLCollection { + namedItem(name: string): Element; +} + +declare var HTMLAllCollection: { + prototype: HTMLAllCollection; + new(): HTMLAllCollection; +} + +interface HTMLAnchorElement extends HTMLElement { + Methods: string; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Contains the anchor portion of the URL including the hash sign (#). + */ + hash: string; + /** + * Contains the hostname and port values of the URL. + */ + host: string; + /** + * Contains the hostname of a URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + mimeType: string; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + nameProp: string; + /** + * Contains the pathname of the URL. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Contains the protocol of the URL. + */ + protocol: string; + protocolLong: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + type: string; + urn: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} + +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +} + +interface HTMLAppletElement extends HTMLElement { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. + */ + contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + /** + * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. + */ + declare: boolean; + form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Sets or retrieves the shape of the object. + */ + name: string; + object: string; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + vspace: number; + width: number; +} + +declare var HTMLAppletElement: { + prototype: HTMLAppletElement; + new(): HTMLAppletElement; +} + +interface HTMLAreaElement extends HTMLElement { + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Sets or retrieves the coordinates of the object. + */ + coords: string; + /** + * Sets or retrieves the subsection of the href property that follows the number sign (#). + */ + hash: string; + /** + * Sets or retrieves the hostname and port number of the location or URL. + */ + host: string; + /** + * Sets or retrieves the host name part of the location or URL. + */ + hostname: string; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or gets whether clicks in this region cause action. + */ + noHref: boolean; + /** + * Sets or retrieves the file name or path specified by the object. + */ + pathname: string; + /** + * Sets or retrieves the port number associated with a URL. + */ + port: string; + /** + * Sets or retrieves the protocol portion of a URL. + */ + protocol: string; + rel: string; + /** + * Sets or retrieves the substring of the href property that follows the question mark. + */ + search: string; + /** + * Sets or retrieves the shape of the object. + */ + shape: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns a string representation of an object. + */ + toString(): string; +} + +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +} + +interface HTMLAreasCollection extends HTMLCollection { + /** + * Adds an element to the areas, controlRange, or options collection. + */ + add(element: HTMLElement, before?: HTMLElement): void; + add(element: HTMLElement, before?: number): void; + /** + * Removes an element from the collection. + */ + remove(index?: number): void; +} + +declare var HTMLAreasCollection: { + prototype: HTMLAreasCollection; + new(): HTMLAreasCollection; +} + +interface HTMLAudioElement extends HTMLMediaElement { +} + +declare var HTMLAudioElement: { + prototype: HTMLAudioElement; + new(): HTMLAudioElement; +} + +interface HTMLBRElement extends HTMLElement { + /** + * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. + */ + clear: string; +} + +declare var HTMLBRElement: { + prototype: HTMLBRElement; + new(): HTMLBRElement; +} + +interface HTMLBaseElement extends HTMLElement { + /** + * Gets or sets the baseline URL on which relative links are based. + */ + href: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; +} + +declare var HTMLBaseElement: { + prototype: HTMLBaseElement; + new(): HTMLBaseElement; +} + +interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + /** + * Sets or retrieves the font size of the object. + */ + size: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBaseFontElement: { + prototype: HTMLBaseFontElement; + new(): HTMLBaseFontElement; +} + +interface HTMLBlockElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + clear: string; + /** + * Sets or retrieves the width of the object. + */ + width: number; +} + +declare var HTMLBlockElement: { + prototype: HTMLBlockElement; + new(): HTMLBlockElement; +} + +interface HTMLBodyElement extends HTMLElement { + aLink: any; + background: string; + bgColor: any; + bgProperties: string; + link: any; + noWrap: boolean; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onblur: (ev: FocusEvent) => any; + onerror: (ev: Event) => any; + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + onload: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpopstate: (ev: PopStateEvent) => any; + onresize: (ev: UIEvent) => any; + onstorage: (ev: StorageEvent) => any; + onunload: (ev: Event) => any; + text: any; + vLink: any; + createTextRange(): TextRange; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLBodyElement: { + prototype: HTMLBodyElement; + new(): HTMLBodyElement; +} + +interface HTMLButtonElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + status: any; + /** + * Gets the classification and default behavior of the button. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Sets or retrieves the default or selected value of the control. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} + +declare var HTMLButtonElement: { + prototype: HTMLButtonElement; + new(): HTMLButtonElement; +} + +interface HTMLCanvasElement extends HTMLElement { + /** + * Gets or sets the height of a canvas element on a document. + */ + height: number; + /** + * Gets or sets the width of a canvas element on a document. + */ + width: number; + /** + * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. + * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); + */ + getContext(contextId: "2d"): CanvasRenderingContext2D; + getContext(contextId: "experimental-webgl"): WebGLRenderingContext; + getContext(contextId: string, ...args: any[]): CanvasRenderingContext2D | WebGLRenderingContext; + /** + * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. + */ + msToBlob(): Blob; + /** + * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. + * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. + */ + toDataURL(type?: string, ...args: any[]): string; +} + +declare var HTMLCanvasElement: { + prototype: HTMLCanvasElement; + new(): HTMLCanvasElement; +} + +interface HTMLCollection { + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Retrieves an object from various collections. + */ + item(nameOrIndex?: any, optionalIndex?: any): Element; + /** + * Retrieves a select object or an object from an options collection. + */ + namedItem(name: string): Element; + [index: number]: Element; +} + +declare var HTMLCollection: { + prototype: HTMLCollection; + new(): HTMLCollection; +} + +interface HTMLDDElement extends HTMLElement { + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; +} + +declare var HTMLDDElement: { + prototype: HTMLDDElement; + new(): HTMLDDElement; +} + +interface HTMLDListElement extends HTMLElement { + compact: boolean; +} + +declare var HTMLDListElement: { + prototype: HTMLDListElement; + new(): HTMLDListElement; +} + +interface HTMLDTElement extends HTMLElement { + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; +} + +declare var HTMLDTElement: { + prototype: HTMLDTElement; + new(): HTMLDTElement; +} + +interface HTMLDataListElement extends HTMLElement { + options: HTMLCollection; +} + +declare var HTMLDataListElement: { + prototype: HTMLDataListElement; + new(): HTMLDataListElement; +} + +interface HTMLDirectoryElement extends HTMLElement { + compact: boolean; +} + +declare var HTMLDirectoryElement: { + prototype: HTMLDirectoryElement; + new(): HTMLDirectoryElement; +} + +interface HTMLDivElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; +} + +declare var HTMLDivElement: { + prototype: HTMLDivElement; + new(): HTMLDivElement; +} + +interface HTMLDocument extends Document { +} + +declare var HTMLDocument: { + prototype: HTMLDocument; + new(): HTMLDocument; +} + +interface HTMLElement extends Element { + accessKey: string; + children: HTMLCollection; + className: string; + contentEditable: string; + dataset: DOMStringMap; + dir: string; + draggable: boolean; + hidden: boolean; + hideFocus: boolean; + id: string; + innerHTML: string; + innerText: string; + isContentEditable: boolean; + lang: string; + offsetHeight: number; + offsetLeft: number; + offsetParent: Element; + offsetTop: number; + offsetWidth: number; + onabort: (ev: Event) => any; + onactivate: (ev: UIEvent) => any; + onbeforeactivate: (ev: UIEvent) => any; + onbeforecopy: (ev: DragEvent) => any; + onbeforecut: (ev: DragEvent) => any; + onbeforedeactivate: (ev: UIEvent) => any; + onbeforepaste: (ev: DragEvent) => any; + onblur: (ev: FocusEvent) => any; + oncanplay: (ev: Event) => any; + oncanplaythrough: (ev: Event) => any; + onchange: (ev: Event) => any; + onclick: (ev: MouseEvent) => any; + oncontextmenu: (ev: PointerEvent) => any; + oncopy: (ev: DragEvent) => any; + oncuechange: (ev: Event) => any; + oncut: (ev: DragEvent) => any; + ondblclick: (ev: MouseEvent) => any; + ondeactivate: (ev: UIEvent) => any; + ondrag: (ev: DragEvent) => any; + ondragend: (ev: DragEvent) => any; + ondragenter: (ev: DragEvent) => any; + ondragleave: (ev: DragEvent) => any; + ondragover: (ev: DragEvent) => any; + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + ondurationchange: (ev: Event) => any; + onemptied: (ev: Event) => any; + onended: (ev: Event) => any; + onerror: (ev: Event) => any; + onfocus: (ev: FocusEvent) => any; + oninput: (ev: Event) => any; + onkeydown: (ev: KeyboardEvent) => any; + onkeypress: (ev: KeyboardEvent) => any; + onkeyup: (ev: KeyboardEvent) => any; + onload: (ev: Event) => any; + onloadeddata: (ev: Event) => any; + onloadedmetadata: (ev: Event) => any; + onloadstart: (ev: Event) => any; + onmousedown: (ev: MouseEvent) => any; + onmouseenter: (ev: MouseEvent) => any; + onmouseleave: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + onmousewheel: (ev: MouseWheelEvent) => any; + onmscontentzoom: (ev: UIEvent) => any; + onmsmanipulationstatechanged: (ev: MSManipulationEvent) => any; + onpaste: (ev: DragEvent) => any; + onpause: (ev: Event) => any; + onplay: (ev: Event) => any; + onplaying: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + onratechange: (ev: Event) => any; + onreset: (ev: Event) => any; + onscroll: (ev: UIEvent) => any; + onseeked: (ev: Event) => any; + onseeking: (ev: Event) => any; + onselect: (ev: UIEvent) => any; + onselectstart: (ev: Event) => any; + onstalled: (ev: Event) => any; + onsubmit: (ev: Event) => any; + onsuspend: (ev: Event) => any; + ontimeupdate: (ev: Event) => any; + onvolumechange: (ev: Event) => any; + onwaiting: (ev: Event) => any; + outerHTML: string; + outerText: string; + spellcheck: boolean; + style: CSSStyleDeclaration; + tabIndex: number; + title: string; + blur(): void; + click(): void; + contains(child: HTMLElement): boolean; + dragDrop(): boolean; + focus(): void; + getElementsByClassName(classNames: string): NodeList; + insertAdjacentElement(position: string, insertedElement: Element): Element; + insertAdjacentHTML(where: string, html: string): void; + insertAdjacentText(where: string, text: string): void; + msGetInputContext(): MSInputMethodContext; + scrollIntoView(top?: boolean): void; + setActive(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLElement: { + prototype: HTMLElement; + new(): HTMLElement; +} + +interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves the height of the object. + */ + height: string; + hidden: any; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Retrieves the palette used for the embedded document. + */ + palette: string; + /** + * Retrieves the URL of the plug-in used to view an embedded document. + */ + pluginspage: string; + readyState: string; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the height and width units of the embed object. + */ + units: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLEmbedElement: { + prototype: HTMLEmbedElement; + new(): HTMLEmbedElement; +} + +interface HTMLFieldSetElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; +} + +declare var HTMLFieldSetElement: { + prototype: HTMLFieldSetElement; + new(): HTMLFieldSetElement; +} + +interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves the current typeface family. + */ + face: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFontElement: { + prototype: HTMLFontElement; + new(): HTMLFontElement; +} + +interface HTMLFormElement extends HTMLElement { + /** + * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. + */ + acceptCharset: string; + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Retrieves a collection, in source order, of all controls in a given form. + */ + elements: HTMLCollection; + /** + * Sets or retrieves the MIME encoding for the form. + */ + encoding: string; + /** + * Sets or retrieves the encoding type for the form. + */ + enctype: string; + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves how to send the form data to the server. + */ + method: string; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Designates a form that is not validated when submitted. + */ + noValidate: boolean; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Retrieves a form object or an object from an elements collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a form object or an object from an elements collection. + */ + namedItem(name: string): any; + /** + * Fires when the user resets a form. + */ + reset(): void; + /** + * Fires when a FORM is about to be submitted. + */ + submit(): void; + [name: string]: any; +} + +declare var HTMLFormElement: { + prototype: HTMLFormElement; + new(): HTMLFormElement; +} + +interface HTMLFrameElement extends HTMLElement, GetSVGDocument { + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string | number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the width of the object. + */ + width: string | number; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameElement: { + prototype: HTMLFrameElement; + new(): HTMLFrameElement; +} + +interface HTMLFrameSetElement extends HTMLElement { + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Sets or retrieves the frame widths of the object. + */ + cols: string; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + name: string; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + /** + * Fires when the object loses the input focus. + */ + onblur: (ev: FocusEvent) => any; + onerror: (ev: Event) => any; + /** + * Fires when the object receives focus. + */ + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + onload: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onresize: (ev: UIEvent) => any; + onstorage: (ev: StorageEvent) => any; + onunload: (ev: Event) => any; + /** + * Sets or retrieves the frame heights of the object. + */ + rows: string; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLFrameSetElement: { + prototype: HTMLFrameSetElement; + new(): HTMLFrameSetElement; +} + +interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. + */ + noShade: boolean; + /** + * Sets or retrieves the width of the object. + */ + width: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLHRElement: { + prototype: HTMLHRElement; + new(): HTMLHRElement; +} + +interface HTMLHeadElement extends HTMLElement { + profile: string; +} + +declare var HTMLHeadElement: { + prototype: HTMLHeadElement; + new(): HTMLHeadElement; +} + +interface HTMLHeadingElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + clear: string; +} + +declare var HTMLHeadingElement: { + prototype: HTMLHeadingElement; + new(): HTMLHeadingElement; +} + +interface HTMLHtmlElement extends HTMLElement { + /** + * Sets or retrieves the DTD version that governs the current document. + */ + version: string; +} + +declare var HTMLHtmlElement: { + prototype: HTMLHtmlElement; + new(): HTMLHtmlElement; +} + +interface HTMLIFrameElement extends HTMLElement, GetSVGDocument { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + allowFullscreen: boolean; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Retrieves the object of the specified. + */ + contentWindow: Window; + /** + * Sets or retrieves whether to display a border for the frame. + */ + frameBorder: string; + /** + * Sets or retrieves the amount of additional space between the frames. + */ + frameSpacing: any; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the horizontal margin for the object. + */ + hspace: number; + /** + * Sets or retrieves a URI to a long description of the object. + */ + longDesc: string; + /** + * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. + */ + marginHeight: string; + /** + * Sets or retrieves the left and right margin widths before displaying the text in a frame. + */ + marginWidth: string; + /** + * Sets or retrieves the frame name. + */ + name: string; + /** + * Sets or retrieves whether the user can resize the frame. + */ + noResize: boolean; + /** + * Raised when the object has been completely received from the server. + */ + onload: (ev: Event) => any; + sandbox: DOMSettableTokenList; + /** + * Sets or retrieves whether the frame can be scrolled. + */ + scrolling: string; + /** + * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. + */ + security: any; + /** + * Sets or retrieves a URL to be loaded by the object. + */ + src: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLIFrameElement: { + prototype: HTMLIFrameElement; + new(): HTMLIFrameElement; +} + +interface HTMLImageElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies the properties of a border drawn around an object. + */ + border: string; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + crossOrigin: string; + currentSrc: string; + /** + * Sets or retrieves the height of the object. + */ + height: number; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + /** + * Sets or retrieves whether the image is a server-side image map. + */ + isMap: boolean; + /** + * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. + */ + longDesc: string; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * The original height of the image resource before sizing. + */ + naturalHeight: number; + /** + * The original width of the image resource before sizing. + */ + naturalWidth: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + srcset: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: number; + x: number; + y: number; + msGetAsCastingSource(): any; +} + +declare var HTMLImageElement: { + prototype: HTMLImageElement; + new(): HTMLImageElement; + create(): HTMLImageElement; +} + +interface HTMLInputElement extends HTMLElement { + /** + * Sets or retrieves a comma-separated list of content types. + */ + accept: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Specifies whether autocomplete is applied to an editable text field. + */ + autocomplete: string; + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the state of the check box or radio button. + */ + checked: boolean; + /** + * Retrieves whether the object is fully loaded. + */ + complete: boolean; + /** + * Sets or retrieves the state of the check box or radio button. + */ + defaultChecked: boolean; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + disabled: boolean; + /** + * Returns a FileList object on a file type input object. + */ + files: FileList; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Overrides the action attribute (where the data on a form is sent) on the parent form element. + */ + formAction: string; + /** + * Used to override the encoding (formEnctype attribute) specified on the form element. + */ + formEnctype: string; + /** + * Overrides the submit method attribute previously specified on a form element. + */ + formMethod: string; + /** + * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. + */ + formNoValidate: string; + /** + * Overrides the target attribute on a form element. + */ + formTarget: string; + /** + * Sets or retrieves the height of the object. + */ + height: string; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + hspace: number; + indeterminate: boolean; + /** + * Specifies the ID of a pre-defined datalist of options for an input element. + */ + list: HTMLElement; + /** + * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. + */ + max: string; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. + */ + min: string; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets a string containing a regular expression that the user's input must match. + */ + pattern: string; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + readOnly: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + size: number; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + status: boolean; + /** + * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. + */ + step: string; + /** + * Returns the content type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Returns the value of the data at the cursor's current position. + */ + value: string; + valueAsDate: Date; + /** + * Returns the input field value as a number. + */ + valueAsNumber: number; + /** + * Sets or retrieves the vertical margin for the object. + */ + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Makes the selection equal to the current object. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; + /** + * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. + * @param n Value to decrement the value by. + */ + stepDown(n?: number): void; + /** + * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. + * @param n Value to increment the value by. + */ + stepUp(n?: number): void; +} + +declare var HTMLInputElement: { + prototype: HTMLInputElement; + new(): HTMLInputElement; +} + +interface HTMLIsIndexElement extends HTMLElement { + /** + * Sets or retrieves the URL to which the form content is sent for processing. + */ + action: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + prompt: string; +} + +declare var HTMLIsIndexElement: { + prototype: HTMLIsIndexElement; + new(): HTMLIsIndexElement; +} + +interface HTMLLIElement extends HTMLElement { + type: string; + /** + * Sets or retrieves the value of a list item. + */ + value: number; +} + +declare var HTMLLIElement: { + prototype: HTMLLIElement; + new(): HTMLLIElement; +} + +interface HTMLLabelElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the object to which the given label object is assigned. + */ + htmlFor: string; +} + +declare var HTMLLabelElement: { + prototype: HTMLLabelElement; + new(): HTMLLabelElement; +} + +interface HTMLLegendElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + align: string; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; +} + +declare var HTMLLegendElement: { + prototype: HTMLLegendElement; + new(): HTMLLegendElement; +} + +interface HTMLLinkElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + disabled: boolean; + /** + * Sets or retrieves a destination URL or an anchor point. + */ + href: string; + /** + * Sets or retrieves the language code of the object. + */ + hreflang: string; + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rel: string; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + */ + rev: string; + /** + * Sets or retrieves the window or frame at which to target content. + */ + target: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLLinkElement: { + prototype: HTMLLinkElement; + new(): HTMLLinkElement; +} + +interface HTMLMapElement extends HTMLElement { + /** + * Retrieves a collection of the area objects defined for the given map object. + */ + areas: HTMLAreasCollection; + /** + * Sets or retrieves the name of the object. + */ + name: string; +} + +declare var HTMLMapElement: { + prototype: HTMLMapElement; + new(): HTMLMapElement; +} + +interface HTMLMarqueeElement extends HTMLElement { + behavior: string; + bgColor: any; + direction: string; + height: string; + hspace: number; + loop: number; + onbounce: (ev: Event) => any; + onfinish: (ev: Event) => any; + onstart: (ev: Event) => any; + scrollAmount: number; + scrollDelay: number; + trueSpeed: boolean; + vspace: number; + width: string; + start(): void; + stop(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMarqueeElement: { + prototype: HTMLMarqueeElement; + new(): HTMLMarqueeElement; +} + +interface HTMLMediaElement extends HTMLElement { + /** + * Returns an AudioTrackList object with the audio tracks for a given video element. + */ + audioTracks: AudioTrackList; + /** + * Gets or sets a value that indicates whether to start playing the media automatically. + */ + autoplay: boolean; + /** + * Gets a collection of buffered time ranges. + */ + buffered: TimeRanges; + /** + * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). + */ + controls: boolean; + /** + * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. + */ + currentSrc: string; + /** + * Gets or sets the current playback position, in seconds. + */ + currentTime: number; + defaultMuted: boolean; + /** + * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. + */ + defaultPlaybackRate: number; + /** + * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. + */ + duration: number; + /** + * Gets information about whether the playback has ended or not. + */ + ended: boolean; + /** + * Returns an object representing the current error state of the audio or video element. + */ + error: MediaError; + /** + * Gets or sets a flag to specify whether playback should restart after it completes. + */ + loop: boolean; + /** + * Specifies the purpose of the audio or video media, such as background audio or alerts. + */ + msAudioCategory: string; + /** + * Specifies the output device id that the audio will be sent to. + */ + msAudioDeviceType: string; + msGraphicsTrustStatus: MSGraphicsTrust; + /** + * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. + */ + msKeys: MSMediaKeys; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Specifies whether or not to enable low-latency playback on the media element. + */ + msRealTime: boolean; + /** + * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. + */ + muted: boolean; + /** + * Gets the current network activity for the element. + */ + networkState: number; + onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; + /** + * Gets a flag that specifies whether playback is paused. + */ + paused: boolean; + /** + * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. + */ + playbackRate: number; + /** + * Gets TimeRanges for the current media resource that has been played. + */ + played: TimeRanges; + /** + * Gets or sets the current playback position, in seconds. + */ + preload: string; + readyState: any; + /** + * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. + */ + seekable: TimeRanges; + /** + * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. + */ + seeking: boolean; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + textTracks: TextTrackList; + videoTracks: VideoTrackList; + /** + * Gets or sets the volume level for audio portions of the media element. + */ + volume: number; + addTextTrack(kind: string, label?: string, language?: string): TextTrack; + /** + * Returns a string that specifies whether the client can play a given media resource type. + */ + canPlayType(type: string): string; + /** + * Fires immediately after the client loads the object. + */ + load(): void; + /** + * Clears all effects from the media pipeline. + */ + msClearEffects(): void; + msGetAsCastingSource(): any; + /** + * Inserts the specified audio effect into media pipeline. + */ + msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetMediaKeys(mediaKeys: MSMediaKeys): void; + /** + * Specifies the media protection manager for a given media pipeline. + */ + msSetMediaProtectionManager(mediaProtectionManager?: any): void; + /** + * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. + */ + pause(): void; + /** + * Loads and starts playback of a media resource. + */ + play(): void; + HAVE_CURRENT_DATA: number; + HAVE_ENOUGH_DATA: number; + HAVE_FUTURE_DATA: number; + HAVE_METADATA: number; + HAVE_NOTHING: number; + NETWORK_EMPTY: number; + NETWORK_IDLE: number; + NETWORK_LOADING: number; + NETWORK_NO_SOURCE: number; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLMediaElement: { + prototype: HTMLMediaElement; + new(): HTMLMediaElement; + HAVE_CURRENT_DATA: number; + HAVE_ENOUGH_DATA: number; + HAVE_FUTURE_DATA: number; + HAVE_METADATA: number; + HAVE_NOTHING: number; + NETWORK_EMPTY: number; + NETWORK_IDLE: number; + NETWORK_LOADING: number; + NETWORK_NO_SOURCE: number; +} + +interface HTMLMenuElement extends HTMLElement { + compact: boolean; + type: string; +} + +declare var HTMLMenuElement: { + prototype: HTMLMenuElement; + new(): HTMLMenuElement; +} + +interface HTMLMetaElement extends HTMLElement { + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Gets or sets meta-information to associate with httpEquiv or name. + */ + content: string; + /** + * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. + */ + httpEquiv: string; + /** + * Sets or retrieves the value specified in the content attribute of the meta object. + */ + name: string; + /** + * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. + */ + scheme: string; + /** + * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. + */ + url: string; +} + +declare var HTMLMetaElement: { + prototype: HTMLMetaElement; + new(): HTMLMetaElement; +} + +interface HTMLModElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLModElement: { + prototype: HTMLModElement; + new(): HTMLModElement; +} + +interface HTMLNextIdElement extends HTMLElement { + n: string; +} + +declare var HTMLNextIdElement: { + prototype: HTMLNextIdElement; + new(): HTMLNextIdElement; +} + +interface HTMLOListElement extends HTMLElement { + compact: boolean; + /** + * The starting number. + */ + start: number; + type: string; +} + +declare var HTMLOListElement: { + prototype: HTMLOListElement; + new(): HTMLOListElement; +} + +interface HTMLObjectElement extends HTMLElement, GetSVGDocument { + /** + * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. + */ + BaseHref: string; + align: string; + /** + * Sets or retrieves a text alternative to the graphic. + */ + alt: string; + /** + * Gets or sets the optional alternative HTML script to execute if the object fails to load. + */ + altHtml: string; + /** + * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. + */ + archive: string; + border: string; + /** + * Sets or retrieves the URL of the file containing the compiled Java class. + */ + code: string; + /** + * Sets or retrieves the URL of the component. + */ + codeBase: string; + /** + * Sets or retrieves the Internet media type for the code associated with the object. + */ + codeType: string; + /** + * Retrieves the document object of the page or frame. + */ + contentDocument: Document; + /** + * Sets or retrieves the URL that references the data of the object. + */ + data: string; + declare: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the height of the object. + */ + height: string; + hspace: number; + /** + * Gets or sets whether the DLNA PlayTo device is available. + */ + msPlayToDisabled: boolean; + /** + * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. + */ + msPlayToPreferredSourceUri: string; + /** + * Gets or sets the primary DLNA PlayTo device. + */ + msPlayToPrimary: boolean; + /** + * Gets the source associated with the media element for use by the PlayToManager. + */ + msPlayToSource: any; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Retrieves the contained object. + */ + object: any; + readyState: number; + /** + * Sets or retrieves a message to be displayed while an object is loading. + */ + standby: string; + /** + * Sets or retrieves the MIME type of the object. + */ + type: string; + /** + * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. + */ + useMap: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + vspace: number; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLObjectElement: { + prototype: HTMLObjectElement; + new(): HTMLObjectElement; +} + +interface HTMLOptGroupElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; +} + +declare var HTMLOptGroupElement: { + prototype: HTMLOptGroupElement; + new(): HTMLOptGroupElement; +} + +interface HTMLOptionElement extends HTMLElement { + /** + * Sets or retrieves the status of an option. + */ + defaultSelected: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the ordinal position of an option in a list box. + */ + index: number; + /** + * Sets or retrieves a value that you can use to implement your own label functionality for the object. + */ + label: string; + /** + * Sets or retrieves whether the option in the list box is the default item. + */ + selected: boolean; + /** + * Sets or retrieves the text string specified by the option tag. + */ + text: string; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; +} + +declare var HTMLOptionElement: { + prototype: HTMLOptionElement; + new(): HTMLOptionElement; + create(): HTMLOptionElement; +} + +interface HTMLParagraphElement extends HTMLElement { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + clear: string; +} + +declare var HTMLParagraphElement: { + prototype: HTMLParagraphElement; + new(): HTMLParagraphElement; +} + +interface HTMLParamElement extends HTMLElement { + /** + * Sets or retrieves the name of an input parameter for an element. + */ + name: string; + /** + * Sets or retrieves the content type of the resource designated by the value attribute. + */ + type: string; + /** + * Sets or retrieves the value of an input parameter for an element. + */ + value: string; + /** + * Sets or retrieves the data type of the value attribute. + */ + valueType: string; +} + +declare var HTMLParamElement: { + prototype: HTMLParamElement; + new(): HTMLParamElement; +} + +interface HTMLPhraseElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLPhraseElement: { + prototype: HTMLPhraseElement; + new(): HTMLPhraseElement; +} + +interface HTMLPreElement extends HTMLElement { + /** + * Indicates a citation by rendering text in italic type. + */ + cite: string; + clear: string; + /** + * Sets or gets a value that you can use to implement your own width functionality for the object. + */ + width: number; +} + +declare var HTMLPreElement: { + prototype: HTMLPreElement; + new(): HTMLPreElement; +} + +interface HTMLProgressElement extends HTMLElement { + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Defines the maximum, or "done" value for a progress element. + */ + max: number; + /** + * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). + */ + position: number; + /** + * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. + */ + value: number; +} + +declare var HTMLProgressElement: { + prototype: HTMLProgressElement; + new(): HTMLProgressElement; +} + +interface HTMLQuoteElement extends HTMLElement { + /** + * Sets or retrieves reference information about the object. + */ + cite: string; + /** + * Sets or retrieves the date and time of a modification to the object. + */ + dateTime: string; +} + +declare var HTMLQuoteElement: { + prototype: HTMLQuoteElement; + new(): HTMLQuoteElement; +} + +interface HTMLScriptElement extends HTMLElement { + async: boolean; + /** + * Sets or retrieves the character set used to encode the object. + */ + charset: string; + /** + * Sets or retrieves the status of the script. + */ + defer: boolean; + /** + * Sets or retrieves the event for which the script is written. + */ + event: string; + /** + * Sets or retrieves the object that is bound to the event script. + */ + htmlFor: string; + /** + * Retrieves the URL to an external file that contains the source code or data. + */ + src: string; + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; + /** + * Sets or retrieves the MIME type for the associated scripting engine. + */ + type: string; +} + +declare var HTMLScriptElement: { + prototype: HTMLScriptElement; + new(): HTMLScriptElement; +} + +interface HTMLSelectElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the number of objects in a collection. + */ + length: number; + /** + * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. + */ + multiple: boolean; + /** + * Sets or retrieves the name of the object. + */ + name: string; + options: HTMLSelectElement; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the index of the selected option in a select object. + */ + selectedIndex: number; + /** + * Sets or retrieves the number of rows in the list box. + */ + size: number; + /** + * Retrieves the type of select control based on the value of the MULTIPLE attribute. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Sets or retrieves the value which is returned to the server when the form control is submitted. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Adds an element to the areas, controlRange, or options collection. + * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. + * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. + */ + add(element: HTMLElement, before?: HTMLElement): void; + add(element: HTMLElement, before?: number): void; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Retrieves a select object or an object from an options collection. + * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. + * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. + */ + item(name?: any, index?: any): any; + /** + * Retrieves a select object or an object from an options collection. + * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. + */ + namedItem(name: string): any; + /** + * Removes an element from the collection. + * @param index Number that specifies the zero-based index of the element to remove from the collection. + */ + remove(index?: number): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + [name: string]: any; +} + +declare var HTMLSelectElement: { + prototype: HTMLSelectElement; + new(): HTMLSelectElement; +} + +interface HTMLSourceElement extends HTMLElement { + /** + * Gets or sets the intended media type of the media source. + */ + media: string; + msKeySystem: string; + /** + * The address or URL of the a media resource that is to be considered. + */ + src: string; + /** + * Gets or sets the MIME type of a media resource. + */ + type: string; +} + +declare var HTMLSourceElement: { + prototype: HTMLSourceElement; + new(): HTMLSourceElement; +} + +interface HTMLSpanElement extends HTMLElement { +} + +declare var HTMLSpanElement: { + prototype: HTMLSpanElement; + new(): HTMLSpanElement; +} + +interface HTMLStyleElement extends HTMLElement, LinkStyle { + /** + * Sets or retrieves the media type. + */ + media: string; + /** + * Retrieves the CSS language in which the style sheet is written. + */ + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLStyleElement: { + prototype: HTMLStyleElement; + new(): HTMLStyleElement; +} + +interface HTMLTableCaptionElement extends HTMLElement { + /** + * Sets or retrieves the alignment of the caption or legend. + */ + align: string; + /** + * Sets or retrieves whether the caption appears at the top or bottom of the table. + */ + vAlign: string; +} + +declare var HTMLTableCaptionElement: { + prototype: HTMLTableCaptionElement; + new(): HTMLTableCaptionElement; +} + +interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves abbreviated text for the object. + */ + abbr: string; + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + /** + * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. + */ + axis: string; + bgColor: any; + /** + * Retrieves the position of the object in the cells collection of a row. + */ + cellIndex: number; + /** + * Sets or retrieves the number columns in the table that the object should span. + */ + colSpan: number; + /** + * Sets or retrieves a list of header cells that provide information for the object. + */ + headers: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves whether the browser automatically performs wordwrap. + */ + noWrap: boolean; + /** + * Sets or retrieves how many rows in a table the cell should span. + */ + rowSpan: number; + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; + /** + * Sets or retrieves the width of the object. + */ + width: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableCellElement: { + prototype: HTMLTableCellElement; + new(): HTMLTableCellElement; +} + +interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves the alignment of the object relative to the display or table. + */ + align: string; + /** + * Sets or retrieves the number of columns in the group. + */ + span: number; + /** + * Sets or retrieves the width of the object. + */ + width: any; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableColElement: { + prototype: HTMLTableColElement; + new(): HTMLTableColElement; +} + +interface HTMLTableDataCellElement extends HTMLTableCellElement { +} + +declare var HTMLTableDataCellElement: { + prototype: HTMLTableDataCellElement; + new(): HTMLTableDataCellElement; +} + +interface HTMLTableElement extends HTMLElement { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + bgColor: any; + /** + * Sets or retrieves the width of the border to draw around the object. + */ + border: string; + /** + * Sets or retrieves the border color of the object. + */ + borderColor: any; + /** + * Retrieves the caption object of a table. + */ + caption: HTMLTableCaptionElement; + /** + * Sets or retrieves the amount of space between the border of the cell and the content of the cell. + */ + cellPadding: string; + /** + * Sets or retrieves the amount of space between cells in a table. + */ + cellSpacing: string; + /** + * Sets or retrieves the number of columns in the table. + */ + cols: number; + /** + * Sets or retrieves the way the border frame around the table is displayed. + */ + frame: string; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollection; + /** + * Sets or retrieves which dividing lines (inner borders) are displayed. + */ + rules: string; + /** + * Sets or retrieves a description and/or structure of the object. + */ + summary: string; + /** + * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. + */ + tBodies: HTMLCollection; + /** + * Retrieves the tFoot object of the table. + */ + tFoot: HTMLTableSectionElement; + /** + * Retrieves the tHead object of the table. + */ + tHead: HTMLTableSectionElement; + /** + * Sets or retrieves the width of the object. + */ + width: string; + /** + * Creates an empty caption element in the table. + */ + createCaption(): HTMLElement; + /** + * Creates an empty tBody element in the table. + */ + createTBody(): HTMLElement; + /** + * Creates an empty tFoot element in the table. + */ + createTFoot(): HTMLElement; + /** + * Returns the tHead element object if successful, or null otherwise. + */ + createTHead(): HTMLElement; + /** + * Deletes the caption element and its contents from the table. + */ + deleteCaption(): void; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Deletes the tFoot element and its contents from the table. + */ + deleteTFoot(): void; + /** + * Deletes the tHead element and its contents from the table. + */ + deleteTHead(): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLElement; +} + +declare var HTMLTableElement: { + prototype: HTMLTableElement; + new(): HTMLTableElement; +} + +interface HTMLTableHeaderCellElement extends HTMLTableCellElement { + /** + * Sets or retrieves the group of cells in a table to which the object's information applies. + */ + scope: string; +} + +declare var HTMLTableHeaderCellElement: { + prototype: HTMLTableHeaderCellElement; + new(): HTMLTableHeaderCellElement; +} + +interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves how the object is aligned with adjacent text. + */ + align: string; + bgColor: any; + /** + * Retrieves a collection of all cells in the table row. + */ + cells: HTMLCollection; + /** + * Sets or retrieves the height of the object. + */ + height: any; + /** + * Retrieves the position of the object in the rows collection for the table. + */ + rowIndex: number; + /** + * Retrieves the position of the object in the collection. + */ + sectionRowIndex: number; + /** + * Removes the specified cell from the table row, as well as from the cells collection. + * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. + */ + deleteCell(index?: number): void; + /** + * Creates a new cell in the table row, and adds the cell to the cells collection. + * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. + */ + insertCell(index?: number): HTMLElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableRowElement: { + prototype: HTMLTableRowElement; + new(): HTMLTableRowElement; +} + +interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment { + /** + * Sets or retrieves a value that indicates the table alignment. + */ + align: string; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: HTMLCollection; + /** + * Removes the specified row (tr) from the element and from the rows collection. + * @param index Number that specifies the zero-based position in the rows collection of the row to remove. + */ + deleteRow(index?: number): void; + /** + * Creates a new row (tr) in the table, and adds the row to the rows collection. + * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. + */ + insertRow(index?: number): HTMLElement; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLTableSectionElement: { + prototype: HTMLTableSectionElement; + new(): HTMLTableSectionElement; +} + +interface HTMLTextAreaElement extends HTMLElement { + /** + * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. + */ + autofocus: boolean; + /** + * Sets or retrieves the width of the object. + */ + cols: number; + /** + * Sets or retrieves the initial contents of the object. + */ + defaultValue: string; + disabled: boolean; + /** + * Retrieves a reference to the form that the object is embedded in. + */ + form: HTMLFormElement; + /** + * Sets or retrieves the maximum number of characters that the user can enter in a text control. + */ + maxLength: number; + /** + * Sets or retrieves the name of the object. + */ + name: string; + /** + * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. + */ + placeholder: string; + /** + * Sets or retrieves the value indicated whether the content of the object is read-only. + */ + readOnly: boolean; + /** + * When present, marks an element that can't be submitted without a value. + */ + required: boolean; + /** + * Sets or retrieves the number of horizontal rows contained in the object. + */ + rows: number; + /** + * Gets or sets the end position or offset of a text selection. + */ + selectionEnd: number; + /** + * Gets or sets the starting position or offset of a text selection. + */ + selectionStart: number; + /** + * Sets or retrieves the value indicating whether the control is selected. + */ + status: any; + /** + * Retrieves the type of control. + */ + type: string; + /** + * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. + */ + validationMessage: string; + /** + * Returns a ValidityState object that represents the validity states of an element. + */ + validity: ValidityState; + /** + * Retrieves or sets the text in the entry field of the textArea element. + */ + value: string; + /** + * Returns whether an element will successfully validate based on forms validation rules and constraints. + */ + willValidate: boolean; + /** + * Sets or retrieves how to handle wordwrapping in the object. + */ + wrap: string; + /** + * Returns whether a form will validate when it is submitted, without having to submit it. + */ + checkValidity(): boolean; + /** + * Creates a TextRange object for the element. + */ + createTextRange(): TextRange; + /** + * Highlights the input area of a form element. + */ + select(): void; + /** + * Sets a custom error message that is displayed when a form is submitted. + * @param error Sets a custom error message that is displayed when a form is submitted. + */ + setCustomValidity(error: string): void; + /** + * Sets the start and end positions of a selection in a text field. + * @param start The offset into the text field for the start of the selection. + * @param end The offset into the text field for the end of the selection. + */ + setSelectionRange(start: number, end: number): void; +} + +declare var HTMLTextAreaElement: { + prototype: HTMLTextAreaElement; + new(): HTMLTextAreaElement; +} + +interface HTMLTitleElement extends HTMLElement { + /** + * Retrieves or sets the text of the object as a string. + */ + text: string; +} + +declare var HTMLTitleElement: { + prototype: HTMLTitleElement; + new(): HTMLTitleElement; +} + +interface HTMLTrackElement extends HTMLElement { + default: boolean; + kind: string; + label: string; + readyState: number; + src: string; + srclang: string; + track: TextTrack; + ERROR: number; + LOADED: number; + LOADING: number; + NONE: number; +} + +declare var HTMLTrackElement: { + prototype: HTMLTrackElement; + new(): HTMLTrackElement; + ERROR: number; + LOADED: number; + LOADING: number; + NONE: number; +} + +interface HTMLUListElement extends HTMLElement { + compact: boolean; + type: string; +} + +declare var HTMLUListElement: { + prototype: HTMLUListElement; + new(): HTMLUListElement; +} + +interface HTMLUnknownElement extends HTMLElement { +} + +declare var HTMLUnknownElement: { + prototype: HTMLUnknownElement; + new(): HTMLUnknownElement; +} + +interface HTMLVideoElement extends HTMLMediaElement { + /** + * Gets or sets the height of the video element. + */ + height: number; + msHorizontalMirror: boolean; + msIsLayoutOptimalForPlayback: boolean; + msIsStereo3D: boolean; + msStereo3DPackingMode: string; + msStereo3DRenderMode: string; + msZoom: boolean; + onMSVideoFormatChanged: (ev: Event) => any; + onMSVideoFrameStepCompleted: (ev: Event) => any; + onMSVideoOptimalLayoutChanged: (ev: Event) => any; + /** + * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. + */ + poster: string; + /** + * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoHeight: number; + /** + * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. + */ + videoWidth: number; + webkitDisplayingFullscreen: boolean; + webkitSupportsFullscreen: boolean; + /** + * Gets or sets the width of the video element. + */ + width: number; + getVideoPlaybackQuality(): VideoPlaybackQuality; + msFrameStep(forward: boolean): void; + msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; + msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; + webkitEnterFullScreen(): void; + webkitEnterFullscreen(): void; + webkitExitFullScreen(): void; + webkitExitFullscreen(): void; + addEventListener(type: "MSContentZoom", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFormatChanged", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; + addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var HTMLVideoElement: { + prototype: HTMLVideoElement; + new(): HTMLVideoElement; +} + +interface HashChangeEvent extends Event { + newURL: string; + oldURL: string; +} + +declare var HashChangeEvent: { + prototype: HashChangeEvent; + new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent; +} + +interface History { + length: number; + state: any; + back(distance?: any): void; + forward(distance?: any): void; + go(delta?: any): void; + pushState(statedata: any, title?: string, url?: string): void; + replaceState(statedata: any, title?: string, url?: string): void; +} + +declare var History: { + prototype: History; + new(): History; +} + +interface IDBCursor { + direction: string; + key: any; + primaryKey: any; + source: any; + advance(count: number): void; + continue(key?: any): void; + delete(): IDBRequest; + update(value: any): IDBRequest; + NEXT: string; + NEXT_NO_DUPLICATE: string; + PREV: string; + PREV_NO_DUPLICATE: string; +} + +declare var IDBCursor: { + prototype: IDBCursor; + new(): IDBCursor; + NEXT: string; + NEXT_NO_DUPLICATE: string; + PREV: string; + PREV_NO_DUPLICATE: string; +} + +interface IDBCursorWithValue extends IDBCursor { + value: any; +} + +declare var IDBCursorWithValue: { + prototype: IDBCursorWithValue; + new(): IDBCursorWithValue; +} + +interface IDBDatabase extends EventTarget { + name: string; + objectStoreNames: DOMStringList; + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + version: string; + close(): void; + createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; + deleteObjectStore(name: string): void; + transaction(storeNames: any, mode?: string): IDBTransaction; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBDatabase: { + prototype: IDBDatabase; + new(): IDBDatabase; +} + +interface IDBFactory { + cmp(first: any, second: any): number; + deleteDatabase(name: string): IDBOpenDBRequest; + open(name: string, version?: number): IDBOpenDBRequest; +} + +declare var IDBFactory: { + prototype: IDBFactory; + new(): IDBFactory; +} + +interface IDBIndex { + keyPath: string; + name: string; + objectStore: IDBObjectStore; + unique: boolean; + count(key?: any): IDBRequest; + get(key: any): IDBRequest; + getKey(key: any): IDBRequest; + openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; + openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; +} + +declare var IDBIndex: { + prototype: IDBIndex; + new(): IDBIndex; +} + +interface IDBKeyRange { + lower: any; + lowerOpen: boolean; + upper: any; + upperOpen: boolean; +} + +declare var IDBKeyRange: { + prototype: IDBKeyRange; + new(): IDBKeyRange; + bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; + lowerBound(bound: any, open?: boolean): IDBKeyRange; + only(value: any): IDBKeyRange; + upperBound(bound: any, open?: boolean): IDBKeyRange; +} + +interface IDBObjectStore { + indexNames: DOMStringList; + keyPath: string; + name: string; + transaction: IDBTransaction; + add(value: any, key?: any): IDBRequest; + clear(): IDBRequest; + count(key?: any): IDBRequest; + createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; + delete(key: any): IDBRequest; + deleteIndex(indexName: string): void; + get(key: any): IDBRequest; + index(name: string): IDBIndex; + openCursor(range?: any, direction?: string): IDBRequest; + put(value: any, key?: any): IDBRequest; +} + +declare var IDBObjectStore: { + prototype: IDBObjectStore; + new(): IDBObjectStore; +} + +interface IDBOpenDBRequest extends IDBRequest { + onblocked: (ev: Event) => any; + onupgradeneeded: (ev: IDBVersionChangeEvent) => any; + addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBOpenDBRequest: { + prototype: IDBOpenDBRequest; + new(): IDBOpenDBRequest; +} + +interface IDBRequest extends EventTarget { + error: DOMError; + onerror: (ev: Event) => any; + onsuccess: (ev: Event) => any; + readyState: string; + result: any; + source: any; + transaction: IDBTransaction; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBRequest: { + prototype: IDBRequest; + new(): IDBRequest; +} + +interface IDBTransaction extends EventTarget { + db: IDBDatabase; + error: DOMError; + mode: string; + onabort: (ev: Event) => any; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + abort(): void; + objectStore(name: string): IDBObjectStore; + READ_ONLY: string; + READ_WRITE: string; + VERSION_CHANGE: string; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var IDBTransaction: { + prototype: IDBTransaction; + new(): IDBTransaction; + READ_ONLY: string; + READ_WRITE: string; + VERSION_CHANGE: string; +} + +interface IDBVersionChangeEvent extends Event { + newVersion: number; + oldVersion: number; +} + +declare var IDBVersionChangeEvent: { + prototype: IDBVersionChangeEvent; + new(): IDBVersionChangeEvent; +} + +interface ImageData { + data: number[]; + height: number; + width: number; +} + +declare var ImageData: { + prototype: ImageData; + new(): ImageData; +} + +interface KeyboardEvent extends UIEvent { + altKey: boolean; + char: string; + charCode: number; + ctrlKey: boolean; + key: string; + keyCode: number; + locale: string; + location: number; + metaKey: boolean; + repeat: boolean; + shiftKey: boolean; + which: number; + getModifierState(keyArg: string): boolean; + initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_MOBILE: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; +} + +declare var KeyboardEvent: { + prototype: KeyboardEvent; + new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent; + DOM_KEY_LOCATION_JOYSTICK: number; + DOM_KEY_LOCATION_LEFT: number; + DOM_KEY_LOCATION_MOBILE: number; + DOM_KEY_LOCATION_NUMPAD: number; + DOM_KEY_LOCATION_RIGHT: number; + DOM_KEY_LOCATION_STANDARD: number; +} + +interface Location { + hash: string; + host: string; + hostname: string; + href: string; + origin: string; + pathname: string; + port: string; + protocol: string; + search: string; + assign(url: string): void; + reload(forcedReload?: boolean): void; + replace(url: string): void; + toString(): string; +} + +declare var Location: { + prototype: Location; + new(): Location; +} + +interface LongRunningScriptDetectedEvent extends Event { + executionTime: number; + stopPageScriptExecution: boolean; +} + +declare var LongRunningScriptDetectedEvent: { + prototype: LongRunningScriptDetectedEvent; + new(): LongRunningScriptDetectedEvent; +} + +interface MSApp { + clearTemporaryWebDataAsync(): MSAppAsyncOperation; + createBlobFromRandomAccessStream(type: string, seeker: any): Blob; + createDataPackage(object: any): any; + createDataPackageFromSelection(): any; + createFileFromStorageFile(storageFile: any): File; + createStreamFromInputStream(type: string, inputStream: any): MSStream; + execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; + execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; + getCurrentPriority(): string; + getHtmlPrintDocumentSourceAsync(htmlDoc: any): any; + getViewId(view: any): any; + isTaskScheduledAtPriorityOrHigher(priority: string): boolean; + pageHandlesAllApplicationActivations(enabled: boolean): void; + suppressSubdownloadCredentialPrompts(suppress: boolean): void; + terminateApp(exceptionObject: any): void; + CURRENT: string; + HIGH: string; + IDLE: string; + NORMAL: string; +} +declare var MSApp: MSApp; + +interface MSAppAsyncOperation extends EventTarget { + error: DOMError; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + readyState: number; + result: any; + start(): void; + COMPLETED: number; + ERROR: number; + STARTED: number; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSAppAsyncOperation: { + prototype: MSAppAsyncOperation; + new(): MSAppAsyncOperation; + COMPLETED: number; + ERROR: number; + STARTED: number; +} + +interface MSBlobBuilder { + append(data: any, endings?: string): void; + getBlob(contentType?: string): Blob; +} + +declare var MSBlobBuilder: { + prototype: MSBlobBuilder; + new(): MSBlobBuilder; +} + +interface MSCSSMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + inverse(): MSCSSMatrix; + multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; + rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; + setMatrixValue(value: string): void; + skewX(angle: number): MSCSSMatrix; + skewY(angle: number): MSCSSMatrix; + toString(): string; + translate(x: number, y: number, z?: number): MSCSSMatrix; +} + +declare var MSCSSMatrix: { + prototype: MSCSSMatrix; + new(text?: string): MSCSSMatrix; +} + +interface MSGesture { + target: Element; + addPointer(pointerId: number): void; + stop(): void; +} + +declare var MSGesture: { + prototype: MSGesture; + new(): MSGesture; +} + +interface MSGestureEvent extends UIEvent { + clientX: number; + clientY: number; + expansion: number; + gestureObject: any; + hwTimestamp: number; + offsetX: number; + offsetY: number; + rotation: number; + scale: number; + screenX: number; + screenY: number; + translationX: number; + translationY: number; + velocityAngular: number; + velocityExpansion: number; + velocityX: number; + velocityY: number; + initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; +} + +declare var MSGestureEvent: { + prototype: MSGestureEvent; + new(): MSGestureEvent; + MSGESTURE_FLAG_BEGIN: number; + MSGESTURE_FLAG_CANCEL: number; + MSGESTURE_FLAG_END: number; + MSGESTURE_FLAG_INERTIA: number; + MSGESTURE_FLAG_NONE: number; +} + +interface MSGraphicsTrust { + constrictionActive: boolean; + status: string; +} + +declare var MSGraphicsTrust: { + prototype: MSGraphicsTrust; + new(): MSGraphicsTrust; +} + +interface MSHTMLWebViewElement extends HTMLElement { + canGoBack: boolean; + canGoForward: boolean; + containsFullScreenElement: boolean; + documentTitle: string; + height: number; + settings: MSWebViewSettings; + src: string; + width: number; + addWebAllowedObject(name: string, applicationObject: any): void; + buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; + capturePreviewToBlobAsync(): MSWebViewAsyncOperation; + captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; + getDeferredPermissionRequestById(id: number): DeferredPermissionRequest; + getDeferredPermissionRequests(): DeferredPermissionRequest[]; + goBack(): void; + goForward(): void; + invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; + navigate(uri: string): void; + navigateToLocalStreamUri(source: string, streamResolver: any): void; + navigateToString(contents: string): void; + navigateWithHttpRequestMessage(requestMessage: any): void; + refresh(): void; + stop(): void; +} + +declare var MSHTMLWebViewElement: { + prototype: MSHTMLWebViewElement; + new(): MSHTMLWebViewElement; +} + +interface MSHeaderFooter { + URL: string; + dateLong: string; + dateShort: string; + font: string; + htmlFoot: string; + htmlHead: string; + page: number; + pageTotal: number; + textFoot: string; + textHead: string; + timeLong: string; + timeShort: string; + title: string; +} + +declare var MSHeaderFooter: { + prototype: MSHeaderFooter; + new(): MSHeaderFooter; +} + +interface MSInputMethodContext extends EventTarget { + compositionEndOffset: number; + compositionStartOffset: number; + oncandidatewindowhide: (ev: Event) => any; + oncandidatewindowshow: (ev: Event) => any; + oncandidatewindowupdate: (ev: Event) => any; + target: HTMLElement; + getCandidateWindowClientRect(): ClientRect; + getCompositionAlternatives(): string[]; + hasComposition(): boolean; + isCandidateWindowVisible(): boolean; + addEventListener(type: "MSCandidateWindowHide", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSCandidateWindowShow", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "MSCandidateWindowUpdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSInputMethodContext: { + prototype: MSInputMethodContext; + new(): MSInputMethodContext; +} + +interface MSManipulationEvent extends UIEvent { + currentState: number; + inertiaDestinationX: number; + inertiaDestinationY: number; + lastState: number; + initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_CANCELLED: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_STOPPED: number; +} + +declare var MSManipulationEvent: { + prototype: MSManipulationEvent; + new(): MSManipulationEvent; + MS_MANIPULATION_STATE_ACTIVE: number; + MS_MANIPULATION_STATE_CANCELLED: number; + MS_MANIPULATION_STATE_COMMITTED: number; + MS_MANIPULATION_STATE_DRAGGING: number; + MS_MANIPULATION_STATE_INERTIA: number; + MS_MANIPULATION_STATE_PRESELECT: number; + MS_MANIPULATION_STATE_SELECTING: number; + MS_MANIPULATION_STATE_STOPPED: number; +} + +interface MSMediaKeyError { + code: number; + systemCode: number; + MS_MEDIA_KEYERR_CLIENT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_UNKNOWN: number; +} + +declare var MSMediaKeyError: { + prototype: MSMediaKeyError; + new(): MSMediaKeyError; + MS_MEDIA_KEYERR_CLIENT: number; + MS_MEDIA_KEYERR_DOMAIN: number; + MS_MEDIA_KEYERR_HARDWARECHANGE: number; + MS_MEDIA_KEYERR_OUTPUT: number; + MS_MEDIA_KEYERR_SERVICE: number; + MS_MEDIA_KEYERR_UNKNOWN: number; +} + +interface MSMediaKeyMessageEvent extends Event { + destinationURL: string; + message: Uint8Array; +} + +declare var MSMediaKeyMessageEvent: { + prototype: MSMediaKeyMessageEvent; + new(): MSMediaKeyMessageEvent; +} + +interface MSMediaKeyNeededEvent extends Event { + initData: Uint8Array; +} + +declare var MSMediaKeyNeededEvent: { + prototype: MSMediaKeyNeededEvent; + new(): MSMediaKeyNeededEvent; +} + +interface MSMediaKeySession extends EventTarget { + error: MSMediaKeyError; + keySystem: string; + sessionId: string; + close(): void; + update(key: Uint8Array): void; +} + +declare var MSMediaKeySession: { + prototype: MSMediaKeySession; + new(): MSMediaKeySession; +} + +interface MSMediaKeys { + keySystem: string; + createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; +} + +declare var MSMediaKeys: { + prototype: MSMediaKeys; + new(keySystem: string): MSMediaKeys; + isTypeSupported(keySystem: string, type?: string): boolean; +} + +interface MSMimeTypesCollection { + length: number; +} + +declare var MSMimeTypesCollection: { + prototype: MSMimeTypesCollection; + new(): MSMimeTypesCollection; +} + +interface MSPluginsCollection { + length: number; + refresh(reload?: boolean): void; +} + +declare var MSPluginsCollection: { + prototype: MSPluginsCollection; + new(): MSPluginsCollection; +} + +interface MSPointerEvent extends MouseEvent { + currentPoint: any; + height: number; + hwTimestamp: number; + intermediatePoints: any; + isPrimary: boolean; + pointerId: number; + pointerType: any; + pressure: number; + rotation: number; + tiltX: number; + tiltY: number; + width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var MSPointerEvent: { + prototype: MSPointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent; +} + +interface MSPrintManagerTemplatePrinter extends MSTemplatePrinter, EventTarget { + percentScale: number; + showHeaderFooter: boolean; + shrinkToFit: boolean; + drawPreviewPage(element: HTMLElement, pageNumber: number): void; + endPrint(): void; + getPrintTaskOptionValue(key: string): any; + invalidatePreview(): void; + setPageCount(pageCount: number): void; + startPrint(): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSPrintManagerTemplatePrinter: { + prototype: MSPrintManagerTemplatePrinter; + new(): MSPrintManagerTemplatePrinter; +} + +interface MSRangeCollection { + length: number; + item(index: number): Range; + [index: number]: Range; +} + +declare var MSRangeCollection: { + prototype: MSRangeCollection; + new(): MSRangeCollection; +} + +interface MSSiteModeEvent extends Event { + actionURL: string; + buttonID: number; +} + +declare var MSSiteModeEvent: { + prototype: MSSiteModeEvent; + new(): MSSiteModeEvent; +} + +interface MSStream { + type: string; + msClose(): void; + msDetachStream(): any; +} + +declare var MSStream: { + prototype: MSStream; + new(): MSStream; +} + +interface MSStreamReader extends EventTarget, MSBaseReader { + error: DOMError; + readAsArrayBuffer(stream: MSStream, size?: number): void; + readAsBinaryString(stream: MSStream, size?: number): void; + readAsBlob(stream: MSStream, size?: number): void; + readAsDataURL(stream: MSStream, size?: number): void; + readAsText(stream: MSStream, encoding?: string, size?: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSStreamReader: { + prototype: MSStreamReader; + new(): MSStreamReader; +} + +interface MSTemplatePrinter { + collate: boolean; + copies: number; + currentPage: boolean; + currentPageAvail: boolean; + duplex: boolean; + footer: string; + frameActive: boolean; + frameActiveEnabled: boolean; + frameAsShown: boolean; + framesetDocument: boolean; + header: string; + headerFooterFont: string; + marginBottom: number; + marginLeft: number; + marginRight: number; + marginTop: number; + orientation: string; + pageFrom: number; + pageHeight: number; + pageTo: number; + pageWidth: number; + selectedPages: boolean; + selection: boolean; + selectionEnabled: boolean; + unprintableBottom: number; + unprintableLeft: number; + unprintableRight: number; + unprintableTop: number; + usePrinterCopyCollate: boolean; + createHeaderFooter(): MSHeaderFooter; + deviceSupports(property: string): any; + ensurePrintDialogDefaults(): boolean; + getPageMarginBottom(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginBottomImportant(pageRule: CSSPageRule): boolean; + getPageMarginLeft(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginLeftImportant(pageRule: CSSPageRule): boolean; + getPageMarginRight(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginRightImportant(pageRule: CSSPageRule): boolean; + getPageMarginTop(pageRule: CSSPageRule, pageWidth: number, pageHeight: number): any; + getPageMarginTopImportant(pageRule: CSSPageRule): boolean; + printBlankPage(): void; + printNonNative(document: any): boolean; + printNonNativeFrames(document: any, activeFrame: boolean): void; + printPage(element: HTMLElement): void; + showPageSetupDialog(): boolean; + showPrintDialog(): boolean; + startDoc(title: string): boolean; + stopDoc(): void; + updatePageStatus(status: number): void; +} + +declare var MSTemplatePrinter: { + prototype: MSTemplatePrinter; + new(): MSTemplatePrinter; +} + +interface MSWebViewAsyncOperation extends EventTarget { + error: DOMError; + oncomplete: (ev: Event) => any; + onerror: (ev: Event) => any; + readyState: number; + result: any; + target: MSHTMLWebViewElement; + type: number; + start(): void; + COMPLETED: number; + ERROR: number; + STARTED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MSWebViewAsyncOperation: { + prototype: MSWebViewAsyncOperation; + new(): MSWebViewAsyncOperation; + COMPLETED: number; + ERROR: number; + STARTED: number; + TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; + TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; + TYPE_INVOKE_SCRIPT: number; +} + +interface MSWebViewSettings { + isIndexedDBEnabled: boolean; + isJavaScriptEnabled: boolean; +} + +declare var MSWebViewSettings: { + prototype: MSWebViewSettings; + new(): MSWebViewSettings; +} + +interface MediaElementAudioSourceNode extends AudioNode { +} + +declare var MediaElementAudioSourceNode: { + prototype: MediaElementAudioSourceNode; + new(): MediaElementAudioSourceNode; +} + +interface MediaError { + code: number; + msExtendedCode: number; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_DECODE: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} + +declare var MediaError: { + prototype: MediaError; + new(): MediaError; + MEDIA_ERR_ABORTED: number; + MEDIA_ERR_DECODE: number; + MEDIA_ERR_NETWORK: number; + MEDIA_ERR_SRC_NOT_SUPPORTED: number; + MS_MEDIA_ERR_ENCRYPTED: number; +} + +interface MediaList { + length: number; + mediaText: string; + appendMedium(newMedium: string): void; + deleteMedium(oldMedium: string): void; + item(index: number): string; + toString(): string; + [index: number]: string; +} + +declare var MediaList: { + prototype: MediaList; + new(): MediaList; +} + +interface MediaQueryList { + matches: boolean; + media: string; + addListener(listener: MediaQueryListListener): void; + removeListener(listener: MediaQueryListListener): void; +} + +declare var MediaQueryList: { + prototype: MediaQueryList; + new(): MediaQueryList; +} + +interface MediaSource extends EventTarget { + activeSourceBuffers: SourceBufferList; + duration: number; + readyState: string; + sourceBuffers: SourceBufferList; + addSourceBuffer(type: string): SourceBuffer; + endOfStream(error?: string): void; + removeSourceBuffer(sourceBuffer: SourceBuffer): void; +} + +declare var MediaSource: { + prototype: MediaSource; + new(): MediaSource; + isTypeSupported(type: string): boolean; +} + +interface MessageChannel { + port1: MessagePort; + port2: MessagePort; +} + +declare var MessageChannel: { + prototype: MessageChannel; + new(): MessageChannel; +} + +interface MessageEvent extends Event { + data: any; + origin: string; + ports: any; + source: Window; + initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; +} + +declare var MessageEvent: { + prototype: MessageEvent; + new(): MessageEvent; +} + +interface MessagePort extends EventTarget { + onmessage: (ev: MessageEvent) => any; + close(): void; + postMessage(message?: any, ports?: any): void; + start(): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var MessagePort: { + prototype: MessagePort; + new(): MessagePort; +} + +interface MimeType { + description: string; + enabledPlugin: Plugin; + suffixes: string; + type: string; +} + +declare var MimeType: { + prototype: MimeType; + new(): MimeType; +} + +interface MimeTypeArray { + length: number; + item(index: number): Plugin; + namedItem(type: string): Plugin; + [index: number]: Plugin; +} + +declare var MimeTypeArray: { + prototype: MimeTypeArray; + new(): MimeTypeArray; +} + +interface MouseEvent extends UIEvent { + altKey: boolean; + button: number; + buttons: number; + clientX: number; + clientY: number; + ctrlKey: boolean; + fromElement: Element; + layerX: number; + layerY: number; + metaKey: boolean; + movementX: number; + movementY: number; + offsetX: number; + offsetY: number; + pageX: number; + pageY: number; + relatedTarget: EventTarget; + screenX: number; + screenY: number; + shiftKey: boolean; + toElement: Element; + which: number; + x: number; + y: number; + getModifierState(keyArg: string): boolean; + initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; +} + +declare var MouseEvent: { + prototype: MouseEvent; + new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent; +} + +interface MouseWheelEvent extends MouseEvent { + wheelDelta: number; + wheelDeltaX: number; + wheelDeltaY: number; + initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; +} + +declare var MouseWheelEvent: { + prototype: MouseWheelEvent; + new(): MouseWheelEvent; +} + +interface MutationEvent extends Event { + attrChange: number; + attrName: string; + newValue: string; + prevValue: string; + relatedNode: Node; + initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; + ADDITION: number; + MODIFICATION: number; + REMOVAL: number; +} + +declare var MutationEvent: { + prototype: MutationEvent; + new(): MutationEvent; + ADDITION: number; + MODIFICATION: number; + REMOVAL: number; +} + +interface MutationObserver { + disconnect(): void; + observe(target: Node, options: MutationObserverInit): void; + takeRecords(): MutationRecord[]; +} + +declare var MutationObserver: { + prototype: MutationObserver; + new(callback: MutationCallback): MutationObserver; +} + +interface MutationRecord { + addedNodes: NodeList; + attributeName: string; + attributeNamespace: string; + nextSibling: Node; + oldValue: string; + previousSibling: Node; + removedNodes: NodeList; + target: Node; + type: string; +} + +declare var MutationRecord: { + prototype: MutationRecord; + new(): MutationRecord; +} + +interface NamedNodeMap { + length: number; + getNamedItem(name: string): Attr; + getNamedItemNS(namespaceURI: string, localName: string): Attr; + item(index: number): Attr; + removeNamedItem(name: string): Attr; + removeNamedItemNS(namespaceURI: string, localName: string): Attr; + setNamedItem(arg: Attr): Attr; + setNamedItemNS(arg: Attr): Attr; + [index: number]: Attr; +} + +declare var NamedNodeMap: { + prototype: NamedNodeMap; + new(): NamedNodeMap; +} + +interface NavigationCompletedEvent extends NavigationEvent { + isSuccess: boolean; + webErrorStatus: number; +} + +declare var NavigationCompletedEvent: { + prototype: NavigationCompletedEvent; + new(): NavigationCompletedEvent; +} + +interface NavigationEvent extends Event { + uri: string; +} + +declare var NavigationEvent: { + prototype: NavigationEvent; + new(): NavigationEvent; +} + +interface NavigationEventWithReferrer extends NavigationEvent { + referer: string; +} + +declare var NavigationEventWithReferrer: { + prototype: NavigationEventWithReferrer; + new(): NavigationEventWithReferrer; +} + +interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver { + appCodeName: string; + appMinorVersion: string; + browserLanguage: string; + connectionSpeed: number; + cookieEnabled: boolean; + cpuClass: string; + language: string; + maxTouchPoints: number; + mimeTypes: MSMimeTypesCollection; + msManipulationViewsEnabled: boolean; + msMaxTouchPoints: number; + msPointerEnabled: boolean; + plugins: MSPluginsCollection; + pointerEnabled: boolean; + systemLanguage: string; + userLanguage: string; + webdriver: boolean; + getGamepads(): Gamepad[]; + javaEnabled(): boolean; + msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Navigator: { + prototype: Navigator; + new(): Navigator; +} + +interface Node extends EventTarget { + attributes: NamedNodeMap; + baseURI: string; + childNodes: NodeList; + firstChild: Node; + lastChild: Node; + localName: string; + namespaceURI: string; + nextSibling: Node; + nodeName: string; + nodeType: number; + nodeValue: string; + ownerDocument: Document; + parentElement: HTMLElement; + parentNode: Node; + prefix: string; + previousSibling: Node; + textContent: string; + appendChild(newChild: Node): Node; + cloneNode(deep?: boolean): Node; + compareDocumentPosition(other: Node): number; + hasAttributes(): boolean; + hasChildNodes(): boolean; + insertBefore(newChild: Node, refChild?: Node): Node; + isDefaultNamespace(namespaceURI: string): boolean; + isEqualNode(arg: Node): boolean; + isSameNode(other: Node): boolean; + lookupNamespaceURI(prefix: string): string; + lookupPrefix(namespaceURI: string): string; + normalize(): void; + removeChild(oldChild: Node): Node; + replaceChild(newChild: Node, oldChild: Node): Node; + ATTRIBUTE_NODE: number; + CDATA_SECTION_NODE: number; + COMMENT_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + DOCUMENT_NODE: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_POSITION_PRECEDING: number; + DOCUMENT_TYPE_NODE: number; + ELEMENT_NODE: number; + ENTITY_NODE: number; + ENTITY_REFERENCE_NODE: number; + NOTATION_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + TEXT_NODE: number; +} + +declare var Node: { + prototype: Node; + new(): Node; + ATTRIBUTE_NODE: number; + CDATA_SECTION_NODE: number; + COMMENT_NODE: number; + DOCUMENT_FRAGMENT_NODE: number; + DOCUMENT_NODE: number; + DOCUMENT_POSITION_CONTAINED_BY: number; + DOCUMENT_POSITION_CONTAINS: number; + DOCUMENT_POSITION_DISCONNECTED: number; + DOCUMENT_POSITION_FOLLOWING: number; + DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; + DOCUMENT_POSITION_PRECEDING: number; + DOCUMENT_TYPE_NODE: number; + ELEMENT_NODE: number; + ENTITY_NODE: number; + ENTITY_REFERENCE_NODE: number; + NOTATION_NODE: number; + PROCESSING_INSTRUCTION_NODE: number; + TEXT_NODE: number; +} + +interface NodeFilter { + FILTER_ACCEPT: number; + FILTER_REJECT: number; + FILTER_SKIP: number; + SHOW_ALL: number; + SHOW_ATTRIBUTE: number; + SHOW_CDATA_SECTION: number; + SHOW_COMMENT: number; + SHOW_DOCUMENT: number; + SHOW_DOCUMENT_FRAGMENT: number; + SHOW_DOCUMENT_TYPE: number; + SHOW_ELEMENT: number; + SHOW_ENTITY: number; + SHOW_ENTITY_REFERENCE: number; + SHOW_NOTATION: number; + SHOW_PROCESSING_INSTRUCTION: number; + SHOW_TEXT: number; +} +declare var NodeFilter: NodeFilter; + +interface NodeIterator { + expandEntityReferences: boolean; + filter: NodeFilter; + root: Node; + whatToShow: number; + detach(): void; + nextNode(): Node; + previousNode(): Node; +} + +declare var NodeIterator: { + prototype: NodeIterator; + new(): NodeIterator; +} + +interface NodeList { + length: number; + item(index: number): Node; + [index: number]: Node; +} + +declare var NodeList: { + prototype: NodeList; + new(): NodeList; +} + +interface OES_element_index_uint { +} + +declare var OES_element_index_uint: { + prototype: OES_element_index_uint; + new(): OES_element_index_uint; +} + +interface OES_standard_derivatives { + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +declare var OES_standard_derivatives: { + prototype: OES_standard_derivatives; + new(): OES_standard_derivatives; + FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; +} + +interface OES_texture_float { +} + +declare var OES_texture_float: { + prototype: OES_texture_float; + new(): OES_texture_float; +} + +interface OES_texture_float_linear { +} + +declare var OES_texture_float_linear: { + prototype: OES_texture_float_linear; + new(): OES_texture_float_linear; +} + +interface OfflineAudioCompletionEvent extends Event { + renderedBuffer: AudioBuffer; +} + +declare var OfflineAudioCompletionEvent: { + prototype: OfflineAudioCompletionEvent; + new(): OfflineAudioCompletionEvent; +} + +interface OfflineAudioContext extends AudioContext { + oncomplete: (ev: Event) => any; + startRendering(): void; + addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OfflineAudioContext: { + prototype: OfflineAudioContext; + new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext; +} + +interface OscillatorNode extends AudioNode { + detune: AudioParam; + frequency: AudioParam; + onended: (ev: Event) => any; + type: string; + setPeriodicWave(periodicWave: PeriodicWave): void; + start(when?: number): void; + stop(when?: number): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var OscillatorNode: { + prototype: OscillatorNode; + new(): OscillatorNode; +} + +interface PageTransitionEvent extends Event { + persisted: boolean; +} + +declare var PageTransitionEvent: { + prototype: PageTransitionEvent; + new(): PageTransitionEvent; +} + +interface PannerNode extends AudioNode { + coneInnerAngle: number; + coneOuterAngle: number; + coneOuterGain: number; + distanceModel: string; + maxDistance: number; + panningModel: string; + refDistance: number; + rolloffFactor: number; + setOrientation(x: number, y: number, z: number): void; + setPosition(x: number, y: number, z: number): void; + setVelocity(x: number, y: number, z: number): void; +} + +declare var PannerNode: { + prototype: PannerNode; + new(): PannerNode; +} + +interface PerfWidgetExternal { + activeNetworkRequestCount: number; + averageFrameTime: number; + averagePaintTime: number; + extraInformationEnabled: boolean; + independentRenderingEnabled: boolean; + irDisablingContentString: string; + irStatusAvailable: boolean; + maxCpuSpeed: number; + paintRequestsPerSecond: number; + performanceCounter: number; + performanceCounterFrequency: number; + addEventListener(eventType: string, callback: Function): void; + getMemoryUsage(): number; + getProcessCpuUsage(): number; + getRecentCpuUsage(last: number): any; + getRecentFrames(last: number): any; + getRecentMemoryUsage(last: number): any; + getRecentPaintRequests(last: number): any; + removeEventListener(eventType: string, callback: Function): void; + repositionWindow(x: number, y: number): void; + resizeWindow(width: number, height: number): void; +} + +declare var PerfWidgetExternal: { + prototype: PerfWidgetExternal; + new(): PerfWidgetExternal; +} + +interface Performance { + navigation: PerformanceNavigation; + timing: PerformanceTiming; + clearMarks(markName?: string): void; + clearMeasures(measureName?: string): void; + clearResourceTimings(): void; + getEntries(): any; + getEntriesByName(name: string, entryType?: string): any; + getEntriesByType(entryType: string): any; + getMarks(markName?: string): any; + getMeasures(measureName?: string): any; + mark(markName: string): void; + measure(measureName: string, startMarkName?: string, endMarkName?: string): void; + now(): number; + setResourceTimingBufferSize(maxSize: number): void; + toJSON(): any; +} + +declare var Performance: { + prototype: Performance; + new(): Performance; +} + +interface PerformanceEntry { + duration: number; + entryType: string; + name: string; + startTime: number; +} + +declare var PerformanceEntry: { + prototype: PerformanceEntry; + new(): PerformanceEntry; +} + +interface PerformanceMark extends PerformanceEntry { +} + +declare var PerformanceMark: { + prototype: PerformanceMark; + new(): PerformanceMark; +} + +interface PerformanceMeasure extends PerformanceEntry { +} + +declare var PerformanceMeasure: { + prototype: PerformanceMeasure; + new(): PerformanceMeasure; +} + +interface PerformanceNavigation { + redirectCount: number; + type: number; + toJSON(): any; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; + TYPE_RELOAD: number; + TYPE_RESERVED: number; +} + +declare var PerformanceNavigation: { + prototype: PerformanceNavigation; + new(): PerformanceNavigation; + TYPE_BACK_FORWARD: number; + TYPE_NAVIGATE: number; + TYPE_RELOAD: number; + TYPE_RESERVED: number; +} + +interface PerformanceNavigationTiming extends PerformanceEntry { + connectEnd: number; + connectStart: number; + domComplete: number; + domContentLoadedEventEnd: number; + domContentLoadedEventStart: number; + domInteractive: number; + domLoading: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + loadEventEnd: number; + loadEventStart: number; + navigationStart: number; + redirectCount: number; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; + type: string; + unloadEventEnd: number; + unloadEventStart: number; +} + +declare var PerformanceNavigationTiming: { + prototype: PerformanceNavigationTiming; + new(): PerformanceNavigationTiming; +} + +interface PerformanceResourceTiming extends PerformanceEntry { + connectEnd: number; + connectStart: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + initiatorType: string; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; +} + +declare var PerformanceResourceTiming: { + prototype: PerformanceResourceTiming; + new(): PerformanceResourceTiming; +} + +interface PerformanceTiming { + connectEnd: number; + connectStart: number; + domComplete: number; + domContentLoadedEventEnd: number; + domContentLoadedEventStart: number; + domInteractive: number; + domLoading: number; + domainLookupEnd: number; + domainLookupStart: number; + fetchStart: number; + loadEventEnd: number; + loadEventStart: number; + msFirstPaint: number; + navigationStart: number; + redirectEnd: number; + redirectStart: number; + requestStart: number; + responseEnd: number; + responseStart: number; + unloadEventEnd: number; + unloadEventStart: number; + toJSON(): any; +} + +declare var PerformanceTiming: { + prototype: PerformanceTiming; + new(): PerformanceTiming; +} + +interface PeriodicWave { +} + +declare var PeriodicWave: { + prototype: PeriodicWave; + new(): PeriodicWave; +} + +interface PermissionRequest extends DeferredPermissionRequest { + state: string; + defer(): void; +} + +declare var PermissionRequest: { + prototype: PermissionRequest; + new(): PermissionRequest; +} + +interface PermissionRequestedEvent extends Event { + permissionRequest: PermissionRequest; +} + +declare var PermissionRequestedEvent: { + prototype: PermissionRequestedEvent; + new(): PermissionRequestedEvent; +} + +interface Plugin { + description: string; + filename: string; + length: number; + name: string; + version: string; + item(index: number): MimeType; + namedItem(type: string): MimeType; + [index: number]: MimeType; +} + +declare var Plugin: { + prototype: Plugin; + new(): Plugin; +} + +interface PluginArray { + length: number; + item(index: number): Plugin; + namedItem(name: string): Plugin; + refresh(reload?: boolean): void; + [index: number]: Plugin; +} + +declare var PluginArray: { + prototype: PluginArray; + new(): PluginArray; +} + +interface PointerEvent extends MouseEvent { + currentPoint: any; + height: number; + hwTimestamp: number; + intermediatePoints: any; + isPrimary: boolean; + pointerId: number; + pointerType: any; + pressure: number; + rotation: number; + tiltX: number; + tiltY: number; + width: number; + getCurrentPoint(element: Element): void; + getIntermediatePoints(element: Element): void; + initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; +} + +declare var PointerEvent: { + prototype: PointerEvent; + new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent; +} + +interface PopStateEvent extends Event { + state: any; + initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; +} + +declare var PopStateEvent: { + prototype: PopStateEvent; + new(): PopStateEvent; +} + +interface Position { + coords: Coordinates; + timestamp: Date; +} + +declare var Position: { + prototype: Position; + new(): Position; +} + +interface PositionError { + code: number; + message: string; + toString(): string; + PERMISSION_DENIED: number; + POSITION_UNAVAILABLE: number; + TIMEOUT: number; +} + +declare var PositionError: { + prototype: PositionError; + new(): PositionError; + PERMISSION_DENIED: number; + POSITION_UNAVAILABLE: number; + TIMEOUT: number; +} + +interface ProcessingInstruction extends CharacterData { + target: string; +} + +declare var ProcessingInstruction: { + prototype: ProcessingInstruction; + new(): ProcessingInstruction; +} + +interface ProgressEvent extends Event { + lengthComputable: boolean; + loaded: number; + total: number; + initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; +} + +declare var ProgressEvent: { + prototype: ProgressEvent; + new(): ProgressEvent; +} + +interface Range { + collapsed: boolean; + commonAncestorContainer: Node; + endContainer: Node; + endOffset: number; + startContainer: Node; + startOffset: number; + cloneContents(): DocumentFragment; + cloneRange(): Range; + collapse(toStart: boolean): void; + compareBoundaryPoints(how: number, sourceRange: Range): number; + createContextualFragment(fragment: string): DocumentFragment; + deleteContents(): void; + detach(): void; + expand(Unit: string): boolean; + extractContents(): DocumentFragment; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + insertNode(newNode: Node): void; + selectNode(refNode: Node): void; + selectNodeContents(refNode: Node): void; + setEnd(refNode: Node, offset: number): void; + setEndAfter(refNode: Node): void; + setEndBefore(refNode: Node): void; + setStart(refNode: Node, offset: number): void; + setStartAfter(refNode: Node): void; + setStartBefore(refNode: Node): void; + surroundContents(newParent: Node): void; + toString(): string; + END_TO_END: number; + END_TO_START: number; + START_TO_END: number; + START_TO_START: number; +} + +declare var Range: { + prototype: Range; + new(): Range; + END_TO_END: number; + END_TO_START: number; + START_TO_END: number; + START_TO_START: number; +} + +interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + target: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGAElement: { + prototype: SVGAElement; + new(): SVGAElement; +} + +interface SVGAngle { + unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; +} + +declare var SVGAngle: { + prototype: SVGAngle; + new(): SVGAngle; + SVG_ANGLETYPE_DEG: number; + SVG_ANGLETYPE_GRAD: number; + SVG_ANGLETYPE_RAD: number; + SVG_ANGLETYPE_UNKNOWN: number; + SVG_ANGLETYPE_UNSPECIFIED: number; +} + +interface SVGAnimatedAngle { + animVal: SVGAngle; + baseVal: SVGAngle; +} + +declare var SVGAnimatedAngle: { + prototype: SVGAnimatedAngle; + new(): SVGAnimatedAngle; +} + +interface SVGAnimatedBoolean { + animVal: boolean; + baseVal: boolean; +} + +declare var SVGAnimatedBoolean: { + prototype: SVGAnimatedBoolean; + new(): SVGAnimatedBoolean; +} + +interface SVGAnimatedEnumeration { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedEnumeration: { + prototype: SVGAnimatedEnumeration; + new(): SVGAnimatedEnumeration; +} + +interface SVGAnimatedInteger { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedInteger: { + prototype: SVGAnimatedInteger; + new(): SVGAnimatedInteger; +} + +interface SVGAnimatedLength { + animVal: SVGLength; + baseVal: SVGLength; +} + +declare var SVGAnimatedLength: { + prototype: SVGAnimatedLength; + new(): SVGAnimatedLength; +} + +interface SVGAnimatedLengthList { + animVal: SVGLengthList; + baseVal: SVGLengthList; +} + +declare var SVGAnimatedLengthList: { + prototype: SVGAnimatedLengthList; + new(): SVGAnimatedLengthList; +} + +interface SVGAnimatedNumber { + animVal: number; + baseVal: number; +} + +declare var SVGAnimatedNumber: { + prototype: SVGAnimatedNumber; + new(): SVGAnimatedNumber; +} + +interface SVGAnimatedNumberList { + animVal: SVGNumberList; + baseVal: SVGNumberList; +} + +declare var SVGAnimatedNumberList: { + prototype: SVGAnimatedNumberList; + new(): SVGAnimatedNumberList; +} + +interface SVGAnimatedPreserveAspectRatio { + animVal: SVGPreserveAspectRatio; + baseVal: SVGPreserveAspectRatio; +} + +declare var SVGAnimatedPreserveAspectRatio: { + prototype: SVGAnimatedPreserveAspectRatio; + new(): SVGAnimatedPreserveAspectRatio; +} + +interface SVGAnimatedRect { + animVal: SVGRect; + baseVal: SVGRect; +} + +declare var SVGAnimatedRect: { + prototype: SVGAnimatedRect; + new(): SVGAnimatedRect; +} + +interface SVGAnimatedString { + animVal: string; + baseVal: string; +} + +declare var SVGAnimatedString: { + prototype: SVGAnimatedString; + new(): SVGAnimatedString; +} + +interface SVGAnimatedTransformList { + animVal: SVGTransformList; + baseVal: SVGTransformList; +} + +declare var SVGAnimatedTransformList: { + prototype: SVGAnimatedTransformList; + new(): SVGAnimatedTransformList; +} + +interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + r: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGCircleElement: { + prototype: SVGCircleElement; + new(): SVGCircleElement; +} + +interface SVGClipPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { + clipPathUnits: SVGAnimatedEnumeration; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGClipPathElement: { + prototype: SVGClipPathElement; + new(): SVGClipPathElement; +} + +interface SVGComponentTransferFunctionElement extends SVGElement { + amplitude: SVGAnimatedNumber; + exponent: SVGAnimatedNumber; + intercept: SVGAnimatedNumber; + offset: SVGAnimatedNumber; + slope: SVGAnimatedNumber; + tableValues: SVGAnimatedNumberList; + type: SVGAnimatedEnumeration; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; +} + +declare var SVGComponentTransferFunctionElement: { + prototype: SVGComponentTransferFunctionElement; + new(): SVGComponentTransferFunctionElement; + SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; + SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; + SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; + SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; + SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; + SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; +} + +interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDefsElement: { + prototype: SVGDefsElement; + new(): SVGDefsElement; +} + +interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGDescElement: { + prototype: SVGDescElement; + new(): SVGDescElement; +} + +interface SVGElement extends Element { + id: string; + onclick: (ev: MouseEvent) => any; + ondblclick: (ev: MouseEvent) => any; + onfocusin: (ev: FocusEvent) => any; + onfocusout: (ev: FocusEvent) => any; + onload: (ev: Event) => any; + onmousedown: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + ownerSVGElement: SVGSVGElement; + viewportElement: SVGElement; + xmlbase: string; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGElement: { + prototype: SVGElement; + new(): SVGElement; +} + +interface SVGElementInstance extends EventTarget { + childNodes: SVGElementInstanceList; + correspondingElement: SVGElement; + correspondingUseElement: SVGUseElement; + firstChild: SVGElementInstance; + lastChild: SVGElementInstance; + nextSibling: SVGElementInstance; + parentNode: SVGElementInstance; + previousSibling: SVGElementInstance; +} + +declare var SVGElementInstance: { + prototype: SVGElementInstance; + new(): SVGElementInstance; +} + +interface SVGElementInstanceList { + length: number; + item(index: number): SVGElementInstance; +} + +declare var SVGElementInstanceList: { + prototype: SVGElementInstanceList; + new(): SVGElementInstanceList; +} + +interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + rx: SVGAnimatedLength; + ry: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGEllipseElement: { + prototype: SVGEllipseElement; + new(): SVGEllipseElement; +} + +interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + in2: SVGAnimatedString; + mode: SVGAnimatedEnumeration; + SVG_FEBLEND_MODE_COLOR: number; + SVG_FEBLEND_MODE_COLOR_BURN: number; + SVG_FEBLEND_MODE_COLOR_DODGE: number; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_DIFFERENCE: number; + SVG_FEBLEND_MODE_EXCLUSION: number; + SVG_FEBLEND_MODE_HARD_LIGHT: number; + SVG_FEBLEND_MODE_HUE: number; + SVG_FEBLEND_MODE_LIGHTEN: number; + SVG_FEBLEND_MODE_LUMINOSITY: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_OVERLAY: number; + SVG_FEBLEND_MODE_SATURATION: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_SOFT_LIGHT: number; + SVG_FEBLEND_MODE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEBlendElement: { + prototype: SVGFEBlendElement; + new(): SVGFEBlendElement; + SVG_FEBLEND_MODE_COLOR: number; + SVG_FEBLEND_MODE_COLOR_BURN: number; + SVG_FEBLEND_MODE_COLOR_DODGE: number; + SVG_FEBLEND_MODE_DARKEN: number; + SVG_FEBLEND_MODE_DIFFERENCE: number; + SVG_FEBLEND_MODE_EXCLUSION: number; + SVG_FEBLEND_MODE_HARD_LIGHT: number; + SVG_FEBLEND_MODE_HUE: number; + SVG_FEBLEND_MODE_LIGHTEN: number; + SVG_FEBLEND_MODE_LUMINOSITY: number; + SVG_FEBLEND_MODE_MULTIPLY: number; + SVG_FEBLEND_MODE_NORMAL: number; + SVG_FEBLEND_MODE_OVERLAY: number; + SVG_FEBLEND_MODE_SATURATION: number; + SVG_FEBLEND_MODE_SCREEN: number; + SVG_FEBLEND_MODE_SOFT_LIGHT: number; + SVG_FEBLEND_MODE_UNKNOWN: number; +} + +interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + type: SVGAnimatedEnumeration; + values: SVGAnimatedNumberList; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEColorMatrixElement: { + prototype: SVGFEColorMatrixElement; + new(): SVGFEColorMatrixElement; + SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; + SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; + SVG_FECOLORMATRIX_TYPE_MATRIX: number; + SVG_FECOLORMATRIX_TYPE_SATURATE: number; + SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; +} + +interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEComponentTransferElement: { + prototype: SVGFEComponentTransferElement; + new(): SVGFEComponentTransferElement; +} + +interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + in2: SVGAnimatedString; + k1: SVGAnimatedNumber; + k2: SVGAnimatedNumber; + k3: SVGAnimatedNumber; + k4: SVGAnimatedNumber; + operator: SVGAnimatedEnumeration; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFECompositeElement: { + prototype: SVGFECompositeElement; + new(): SVGFECompositeElement; + SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; + SVG_FECOMPOSITE_OPERATOR_ATOP: number; + SVG_FECOMPOSITE_OPERATOR_IN: number; + SVG_FECOMPOSITE_OPERATOR_OUT: number; + SVG_FECOMPOSITE_OPERATOR_OVER: number; + SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; + SVG_FECOMPOSITE_OPERATOR_XOR: number; +} + +interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + bias: SVGAnimatedNumber; + divisor: SVGAnimatedNumber; + edgeMode: SVGAnimatedEnumeration; + in1: SVGAnimatedString; + kernelMatrix: SVGAnimatedNumberList; + kernelUnitLengthX: SVGAnimatedNumber; + kernelUnitLengthY: SVGAnimatedNumber; + orderX: SVGAnimatedInteger; + orderY: SVGAnimatedInteger; + preserveAlpha: SVGAnimatedBoolean; + targetX: SVGAnimatedInteger; + targetY: SVGAnimatedInteger; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_NONE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_WRAP: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEConvolveMatrixElement: { + prototype: SVGFEConvolveMatrixElement; + new(): SVGFEConvolveMatrixElement; + SVG_EDGEMODE_DUPLICATE: number; + SVG_EDGEMODE_NONE: number; + SVG_EDGEMODE_UNKNOWN: number; + SVG_EDGEMODE_WRAP: number; +} + +interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + diffuseConstant: SVGAnimatedNumber; + in1: SVGAnimatedString; + kernelUnitLengthX: SVGAnimatedNumber; + kernelUnitLengthY: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDiffuseLightingElement: { + prototype: SVGFEDiffuseLightingElement; + new(): SVGFEDiffuseLightingElement; +} + +interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + in2: SVGAnimatedString; + scale: SVGAnimatedNumber; + xChannelSelector: SVGAnimatedEnumeration; + yChannelSelector: SVGAnimatedEnumeration; + SVG_CHANNEL_A: number; + SVG_CHANNEL_B: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEDisplacementMapElement: { + prototype: SVGFEDisplacementMapElement; + new(): SVGFEDisplacementMapElement; + SVG_CHANNEL_A: number; + SVG_CHANNEL_B: number; + SVG_CHANNEL_G: number; + SVG_CHANNEL_R: number; + SVG_CHANNEL_UNKNOWN: number; +} + +interface SVGFEDistantLightElement extends SVGElement { + azimuth: SVGAnimatedNumber; + elevation: SVGAnimatedNumber; +} + +declare var SVGFEDistantLightElement: { + prototype: SVGFEDistantLightElement; + new(): SVGFEDistantLightElement; +} + +interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEFloodElement: { + prototype: SVGFEFloodElement; + new(): SVGFEFloodElement; +} + +interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncAElement: { + prototype: SVGFEFuncAElement; + new(): SVGFEFuncAElement; +} + +interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncBElement: { + prototype: SVGFEFuncBElement; + new(): SVGFEFuncBElement; +} + +interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncGElement: { + prototype: SVGFEFuncGElement; + new(): SVGFEFuncGElement; +} + +interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { +} + +declare var SVGFEFuncRElement: { + prototype: SVGFEFuncRElement; + new(): SVGFEFuncRElement; +} + +interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + stdDeviationX: SVGAnimatedNumber; + stdDeviationY: SVGAnimatedNumber; + setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEGaussianBlurElement: { + prototype: SVGFEGaussianBlurElement; + new(): SVGFEGaussianBlurElement; +} + +interface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEImageElement: { + prototype: SVGFEImageElement; + new(): SVGFEImageElement; +} + +interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMergeElement: { + prototype: SVGFEMergeElement; + new(): SVGFEMergeElement; +} + +interface SVGFEMergeNodeElement extends SVGElement { + in1: SVGAnimatedString; +} + +declare var SVGFEMergeNodeElement: { + prototype: SVGFEMergeNodeElement; + new(): SVGFEMergeNodeElement; +} + +interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + operator: SVGAnimatedEnumeration; + radiusX: SVGAnimatedNumber; + radiusY: SVGAnimatedNumber; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEMorphologyElement: { + prototype: SVGFEMorphologyElement; + new(): SVGFEMorphologyElement; + SVG_MORPHOLOGY_OPERATOR_DILATE: number; + SVG_MORPHOLOGY_OPERATOR_ERODE: number; + SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; +} + +interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + dx: SVGAnimatedNumber; + dy: SVGAnimatedNumber; + in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFEOffsetElement: { + prototype: SVGFEOffsetElement; + new(): SVGFEOffsetElement; +} + +interface SVGFEPointLightElement extends SVGElement { + x: SVGAnimatedNumber; + y: SVGAnimatedNumber; + z: SVGAnimatedNumber; +} + +declare var SVGFEPointLightElement: { + prototype: SVGFEPointLightElement; + new(): SVGFEPointLightElement; +} + +interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + kernelUnitLengthX: SVGAnimatedNumber; + kernelUnitLengthY: SVGAnimatedNumber; + specularConstant: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + surfaceScale: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFESpecularLightingElement: { + prototype: SVGFESpecularLightingElement; + new(): SVGFESpecularLightingElement; +} + +interface SVGFESpotLightElement extends SVGElement { + limitingConeAngle: SVGAnimatedNumber; + pointsAtX: SVGAnimatedNumber; + pointsAtY: SVGAnimatedNumber; + pointsAtZ: SVGAnimatedNumber; + specularExponent: SVGAnimatedNumber; + x: SVGAnimatedNumber; + y: SVGAnimatedNumber; + z: SVGAnimatedNumber; +} + +declare var SVGFESpotLightElement: { + prototype: SVGFESpotLightElement; + new(): SVGFESpotLightElement; +} + +interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + in1: SVGAnimatedString; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETileElement: { + prototype: SVGFETileElement; + new(): SVGFETileElement; +} + +interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { + baseFrequencyX: SVGAnimatedNumber; + baseFrequencyY: SVGAnimatedNumber; + numOctaves: SVGAnimatedInteger; + seed: SVGAnimatedNumber; + stitchTiles: SVGAnimatedEnumeration; + type: SVGAnimatedEnumeration; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_STITCHTYPE_STITCH: number; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFETurbulenceElement: { + prototype: SVGFETurbulenceElement; + new(): SVGFETurbulenceElement; + SVG_STITCHTYPE_NOSTITCH: number; + SVG_STITCHTYPE_STITCH: number; + SVG_STITCHTYPE_UNKNOWN: number; + SVG_TURBULENCE_TYPE_FRACTALNOISE: number; + SVG_TURBULENCE_TYPE_TURBULENCE: number; + SVG_TURBULENCE_TYPE_UNKNOWN: number; +} + +interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { + filterResX: SVGAnimatedInteger; + filterResY: SVGAnimatedInteger; + filterUnits: SVGAnimatedEnumeration; + height: SVGAnimatedLength; + primitiveUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + setFilterRes(filterResX: number, filterResY: number): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGFilterElement: { + prototype: SVGFilterElement; + new(): SVGFilterElement; +} + +interface SVGForeignObjectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + height: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGForeignObjectElement: { + prototype: SVGForeignObjectElement; + new(): SVGForeignObjectElement; +} + +interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGElement: { + prototype: SVGGElement; + new(): SVGGElement; +} + +interface SVGGradientElement extends SVGElement, SVGStylable, SVGExternalResourcesRequired, SVGURIReference, SVGUnitTypes { + gradientTransform: SVGAnimatedTransformList; + gradientUnits: SVGAnimatedEnumeration; + spreadMethod: SVGAnimatedEnumeration; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_REPEAT: number; + SVG_SPREADMETHOD_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGGradientElement: { + prototype: SVGGradientElement; + new(): SVGGradientElement; + SVG_SPREADMETHOD_PAD: number; + SVG_SPREADMETHOD_REFLECT: number; + SVG_SPREADMETHOD_REPEAT: number; + SVG_SPREADMETHOD_UNKNOWN: number; +} + +interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + height: SVGAnimatedLength; + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGImageElement: { + prototype: SVGImageElement; + new(): SVGImageElement; +} + +interface SVGLength { + unitType: number; + value: number; + valueAsString: string; + valueInSpecifiedUnits: number; + convertToSpecifiedUnits(unitType: number): void; + newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_EXS: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; +} + +declare var SVGLength: { + prototype: SVGLength; + new(): SVGLength; + SVG_LENGTHTYPE_CM: number; + SVG_LENGTHTYPE_EMS: number; + SVG_LENGTHTYPE_EXS: number; + SVG_LENGTHTYPE_IN: number; + SVG_LENGTHTYPE_MM: number; + SVG_LENGTHTYPE_NUMBER: number; + SVG_LENGTHTYPE_PC: number; + SVG_LENGTHTYPE_PERCENTAGE: number; + SVG_LENGTHTYPE_PT: number; + SVG_LENGTHTYPE_PX: number; + SVG_LENGTHTYPE_UNKNOWN: number; +} + +interface SVGLengthList { + numberOfItems: number; + appendItem(newItem: SVGLength): SVGLength; + clear(): void; + getItem(index: number): SVGLength; + initialize(newItem: SVGLength): SVGLength; + insertItemBefore(newItem: SVGLength, index: number): SVGLength; + removeItem(index: number): SVGLength; + replaceItem(newItem: SVGLength, index: number): SVGLength; +} + +declare var SVGLengthList: { + prototype: SVGLengthList; + new(): SVGLengthList; +} + +interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + x1: SVGAnimatedLength; + x2: SVGAnimatedLength; + y1: SVGAnimatedLength; + y2: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGLineElement: { + prototype: SVGLineElement; + new(): SVGLineElement; +} + +interface SVGLinearGradientElement extends SVGGradientElement { + x1: SVGAnimatedLength; + x2: SVGAnimatedLength; + y1: SVGAnimatedLength; + y2: SVGAnimatedLength; +} + +declare var SVGLinearGradientElement: { + prototype: SVGLinearGradientElement; + new(): SVGLinearGradientElement; +} + +interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { + markerHeight: SVGAnimatedLength; + markerUnits: SVGAnimatedEnumeration; + markerWidth: SVGAnimatedLength; + orientAngle: SVGAnimatedAngle; + orientType: SVGAnimatedEnumeration; + refX: SVGAnimatedLength; + refY: SVGAnimatedLength; + setOrientToAngle(angle: SVGAngle): void; + setOrientToAuto(): void; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKER_ORIENT_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMarkerElement: { + prototype: SVGMarkerElement; + new(): SVGMarkerElement; + SVG_MARKERUNITS_STROKEWIDTH: number; + SVG_MARKERUNITS_UNKNOWN: number; + SVG_MARKERUNITS_USERSPACEONUSE: number; + SVG_MARKER_ORIENT_ANGLE: number; + SVG_MARKER_ORIENT_AUTO: number; + SVG_MARKER_ORIENT_UNKNOWN: number; +} + +interface SVGMaskElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGUnitTypes { + height: SVGAnimatedLength; + maskContentUnits: SVGAnimatedEnumeration; + maskUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGMaskElement: { + prototype: SVGMaskElement; + new(): SVGMaskElement; +} + +interface SVGMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + flipX(): SVGMatrix; + flipY(): SVGMatrix; + inverse(): SVGMatrix; + multiply(secondMatrix: SVGMatrix): SVGMatrix; + rotate(angle: number): SVGMatrix; + rotateFromVector(x: number, y: number): SVGMatrix; + scale(scaleFactor: number): SVGMatrix; + scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; + skewX(angle: number): SVGMatrix; + skewY(angle: number): SVGMatrix; + translate(x: number, y: number): SVGMatrix; +} + +declare var SVGMatrix: { + prototype: SVGMatrix; + new(): SVGMatrix; +} + +interface SVGMetadataElement extends SVGElement { +} + +declare var SVGMetadataElement: { + prototype: SVGMetadataElement; + new(): SVGMetadataElement; +} + +interface SVGNumber { + value: number; +} + +declare var SVGNumber: { + prototype: SVGNumber; + new(): SVGNumber; +} + +interface SVGNumberList { + numberOfItems: number; + appendItem(newItem: SVGNumber): SVGNumber; + clear(): void; + getItem(index: number): SVGNumber; + initialize(newItem: SVGNumber): SVGNumber; + insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; + removeItem(index: number): SVGNumber; + replaceItem(newItem: SVGNumber, index: number): SVGNumber; +} + +declare var SVGNumberList: { + prototype: SVGNumberList; + new(): SVGNumberList; +} + +interface SVGPathElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPathData { + createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; + createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; + createSVGPathSegClosePath(): SVGPathSegClosePath; + createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; + createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; + createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; + createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; + createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; + createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; + createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; + createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; + createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; + createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; + createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; + createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; + createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; + createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; + createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; + createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; + getPathSegAtLength(distance: number): number; + getPointAtLength(distance: number): SVGPoint; + getTotalLength(): number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPathElement: { + prototype: SVGPathElement; + new(): SVGPathElement; +} + +interface SVGPathSeg { + pathSegType: number; + pathSegTypeAsLetter: string; + PATHSEG_ARC_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_MOVETO_REL: number; + PATHSEG_UNKNOWN: number; +} + +declare var SVGPathSeg: { + prototype: SVGPathSeg; + new(): SVGPathSeg; + PATHSEG_ARC_ABS: number; + PATHSEG_ARC_REL: number; + PATHSEG_CLOSEPATH: number; + PATHSEG_CURVETO_CUBIC_ABS: number; + PATHSEG_CURVETO_CUBIC_REL: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; + PATHSEG_CURVETO_QUADRATIC_ABS: number; + PATHSEG_CURVETO_QUADRATIC_REL: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; + PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; + PATHSEG_LINETO_ABS: number; + PATHSEG_LINETO_HORIZONTAL_ABS: number; + PATHSEG_LINETO_HORIZONTAL_REL: number; + PATHSEG_LINETO_REL: number; + PATHSEG_LINETO_VERTICAL_ABS: number; + PATHSEG_LINETO_VERTICAL_REL: number; + PATHSEG_MOVETO_ABS: number; + PATHSEG_MOVETO_REL: number; + PATHSEG_UNKNOWN: number; +} + +interface SVGPathSegArcAbs extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; + x: number; + y: number; +} + +declare var SVGPathSegArcAbs: { + prototype: SVGPathSegArcAbs; + new(): SVGPathSegArcAbs; +} + +interface SVGPathSegArcRel extends SVGPathSeg { + angle: number; + largeArcFlag: boolean; + r1: number; + r2: number; + sweepFlag: boolean; + x: number; + y: number; +} + +declare var SVGPathSegArcRel: { + prototype: SVGPathSegArcRel; + new(): SVGPathSegArcRel; +} + +interface SVGPathSegClosePath extends SVGPathSeg { +} + +declare var SVGPathSegClosePath: { + prototype: SVGPathSegClosePath; + new(): SVGPathSegClosePath; +} + +interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicAbs: { + prototype: SVGPathSegCurvetoCubicAbs; + new(): SVGPathSegCurvetoCubicAbs; +} + +interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { + x: number; + x1: number; + x2: number; + y: number; + y1: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicRel: { + prototype: SVGPathSegCurvetoCubicRel; + new(): SVGPathSegCurvetoCubicRel; +} + +interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicSmoothAbs: { + prototype: SVGPathSegCurvetoCubicSmoothAbs; + new(): SVGPathSegCurvetoCubicSmoothAbs; +} + +interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { + x: number; + x2: number; + y: number; + y2: number; +} + +declare var SVGPathSegCurvetoCubicSmoothRel: { + prototype: SVGPathSegCurvetoCubicSmoothRel; + new(): SVGPathSegCurvetoCubicSmoothRel; +} + +interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticAbs: { + prototype: SVGPathSegCurvetoQuadraticAbs; + new(): SVGPathSegCurvetoQuadraticAbs; +} + +interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { + x: number; + x1: number; + y: number; + y1: number; +} + +declare var SVGPathSegCurvetoQuadraticRel: { + prototype: SVGPathSegCurvetoQuadraticRel; + new(): SVGPathSegCurvetoQuadraticRel; +} + +interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothAbs: { + prototype: SVGPathSegCurvetoQuadraticSmoothAbs; + new(): SVGPathSegCurvetoQuadraticSmoothAbs; +} + +interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegCurvetoQuadraticSmoothRel: { + prototype: SVGPathSegCurvetoQuadraticSmoothRel; + new(): SVGPathSegCurvetoQuadraticSmoothRel; +} + +interface SVGPathSegLinetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoAbs: { + prototype: SVGPathSegLinetoAbs; + new(): SVGPathSegLinetoAbs; +} + +interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalAbs: { + prototype: SVGPathSegLinetoHorizontalAbs; + new(): SVGPathSegLinetoHorizontalAbs; +} + +interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { + x: number; +} + +declare var SVGPathSegLinetoHorizontalRel: { + prototype: SVGPathSegLinetoHorizontalRel; + new(): SVGPathSegLinetoHorizontalRel; +} + +interface SVGPathSegLinetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegLinetoRel: { + prototype: SVGPathSegLinetoRel; + new(): SVGPathSegLinetoRel; +} + +interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalAbs: { + prototype: SVGPathSegLinetoVerticalAbs; + new(): SVGPathSegLinetoVerticalAbs; +} + +interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { + y: number; +} + +declare var SVGPathSegLinetoVerticalRel: { + prototype: SVGPathSegLinetoVerticalRel; + new(): SVGPathSegLinetoVerticalRel; +} + +interface SVGPathSegList { + numberOfItems: number; + appendItem(newItem: SVGPathSeg): SVGPathSeg; + clear(): void; + getItem(index: number): SVGPathSeg; + initialize(newItem: SVGPathSeg): SVGPathSeg; + insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; + removeItem(index: number): SVGPathSeg; + replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; +} + +declare var SVGPathSegList: { + prototype: SVGPathSegList; + new(): SVGPathSegList; +} + +interface SVGPathSegMovetoAbs extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoAbs: { + prototype: SVGPathSegMovetoAbs; + new(): SVGPathSegMovetoAbs; +} + +interface SVGPathSegMovetoRel extends SVGPathSeg { + x: number; + y: number; +} + +declare var SVGPathSegMovetoRel: { + prototype: SVGPathSegMovetoRel; + new(): SVGPathSegMovetoRel; +} + +interface SVGPatternElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGURIReference, SVGUnitTypes { + height: SVGAnimatedLength; + patternContentUnits: SVGAnimatedEnumeration; + patternTransform: SVGAnimatedTransformList; + patternUnits: SVGAnimatedEnumeration; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPatternElement: { + prototype: SVGPatternElement; + new(): SVGPatternElement; +} + +interface SVGPoint { + x: number; + y: number; + matrixTransform(matrix: SVGMatrix): SVGPoint; +} + +declare var SVGPoint: { + prototype: SVGPoint; + new(): SVGPoint; +} + +interface SVGPointList { + numberOfItems: number; + appendItem(newItem: SVGPoint): SVGPoint; + clear(): void; + getItem(index: number): SVGPoint; + initialize(newItem: SVGPoint): SVGPoint; + insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; + removeItem(index: number): SVGPoint; + replaceItem(newItem: SVGPoint, index: number): SVGPoint; +} + +declare var SVGPointList: { + prototype: SVGPointList; + new(): SVGPointList; +} + +interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolygonElement: { + prototype: SVGPolygonElement; + new(): SVGPolygonElement; +} + +interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGAnimatedPoints { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGPolylineElement: { + prototype: SVGPolylineElement; + new(): SVGPolylineElement; +} + +interface SVGPreserveAspectRatio { + align: number; + meetOrSlice: number; + SVG_MEETORSLICE_MEET: number; + SVG_MEETORSLICE_SLICE: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +declare var SVGPreserveAspectRatio: { + prototype: SVGPreserveAspectRatio; + new(): SVGPreserveAspectRatio; + SVG_MEETORSLICE_MEET: number; + SVG_MEETORSLICE_SLICE: number; + SVG_MEETORSLICE_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_NONE: number; + SVG_PRESERVEASPECTRATIO_UNKNOWN: number; + SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; + SVG_PRESERVEASPECTRATIO_XMAXYMID: number; + SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; + SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; + SVG_PRESERVEASPECTRATIO_XMIDYMID: number; + SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; + SVG_PRESERVEASPECTRATIO_XMINYMAX: number; + SVG_PRESERVEASPECTRATIO_XMINYMID: number; + SVG_PRESERVEASPECTRATIO_XMINYMIN: number; +} + +interface SVGRadialGradientElement extends SVGGradientElement { + cx: SVGAnimatedLength; + cy: SVGAnimatedLength; + fx: SVGAnimatedLength; + fy: SVGAnimatedLength; + r: SVGAnimatedLength; +} + +declare var SVGRadialGradientElement: { + prototype: SVGRadialGradientElement; + new(): SVGRadialGradientElement; +} + +interface SVGRect { + height: number; + width: number; + x: number; + y: number; +} + +declare var SVGRect: { + prototype: SVGRect; + new(): SVGRect; +} + +interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + height: SVGAnimatedLength; + rx: SVGAnimatedLength; + ry: SVGAnimatedLength; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGRectElement: { + prototype: SVGRectElement; + new(): SVGRectElement; +} + +interface SVGSVGElement extends SVGElement, DocumentEvent, SVGLocatable, SVGTests, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { + contentScriptType: string; + contentStyleType: string; + currentScale: number; + currentTranslate: SVGPoint; + height: SVGAnimatedLength; + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + onscroll: (ev: UIEvent) => any; + onunload: (ev: Event) => any; + onzoom: (ev: SVGZoomEvent) => any; + pixelUnitToMillimeterX: number; + pixelUnitToMillimeterY: number; + screenPixelToMillimeterX: number; + screenPixelToMillimeterY: number; + viewport: SVGRect; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + checkEnclosure(element: SVGElement, rect: SVGRect): boolean; + checkIntersection(element: SVGElement, rect: SVGRect): boolean; + createSVGAngle(): SVGAngle; + createSVGLength(): SVGLength; + createSVGMatrix(): SVGMatrix; + createSVGNumber(): SVGNumber; + createSVGPoint(): SVGPoint; + createSVGRect(): SVGRect; + createSVGTransform(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + deselectAll(): void; + forceRedraw(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getCurrentTime(): number; + getElementById(elementId: string): Element; + getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; + getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; + pauseAnimations(): void; + setCurrentTime(seconds: number): void; + suspendRedraw(maxWaitMilliseconds: number): number; + unpauseAnimations(): void; + unsuspendRedraw(suspendHandleID: number): void; + unsuspendRedrawAll(): void; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "SVGAbort", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGError", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGUnload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "SVGZoom", listener: (ev: SVGZoomEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ariarequest", listener: (ev: AriaRequestEvent) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "command", listener: (ev: CommandEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchcancel", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchend", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchmove", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "touchstart", listener: (ev: TouchEvent) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "webkitfullscreenerror", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSVGElement: { + prototype: SVGSVGElement; + new(): SVGSVGElement; +} + +interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGScriptElement: { + prototype: SVGScriptElement; + new(): SVGScriptElement; +} + +interface SVGStopElement extends SVGElement, SVGStylable { + offset: SVGAnimatedNumber; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStopElement: { + prototype: SVGStopElement; + new(): SVGStopElement; +} + +interface SVGStringList { + numberOfItems: number; + appendItem(newItem: string): string; + clear(): void; + getItem(index: number): string; + initialize(newItem: string): string; + insertItemBefore(newItem: string, index: number): string; + removeItem(index: number): string; + replaceItem(newItem: string, index: number): string; +} + +declare var SVGStringList: { + prototype: SVGStringList; + new(): SVGStringList; +} + +interface SVGStyleElement extends SVGElement, SVGLangSpace { + media: string; + title: string; + type: string; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGStyleElement: { + prototype: SVGStyleElement; + new(): SVGStyleElement; +} + +interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSwitchElement: { + prototype: SVGSwitchElement; + new(): SVGSwitchElement; +} + +interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGExternalResourcesRequired, SVGFitToViewBox { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGSymbolElement: { + prototype: SVGSymbolElement; + new(): SVGSymbolElement; +} + +interface SVGTSpanElement extends SVGTextPositioningElement { +} + +declare var SVGTSpanElement: { + prototype: SVGTSpanElement; + new(): SVGTSpanElement; +} + +interface SVGTextContentElement extends SVGElement, SVGStylable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired { + lengthAdjust: SVGAnimatedEnumeration; + textLength: SVGAnimatedLength; + getCharNumAtPosition(point: SVGPoint): number; + getComputedTextLength(): number; + getEndPositionOfChar(charnum: number): SVGPoint; + getExtentOfChar(charnum: number): SVGRect; + getNumberOfChars(): number; + getRotationOfChar(charnum: number): number; + getStartPositionOfChar(charnum: number): SVGPoint; + getSubStringLength(charnum: number, nchars: number): number; + selectSubString(charnum: number, nchars: number): void; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextContentElement: { + prototype: SVGTextContentElement; + new(): SVGTextContentElement; + LENGTHADJUST_SPACING: number; + LENGTHADJUST_SPACINGANDGLYPHS: number; + LENGTHADJUST_UNKNOWN: number; +} + +interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextElement: { + prototype: SVGTextElement; + new(): SVGTextElement; +} + +interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { + method: SVGAnimatedEnumeration; + spacing: SVGAnimatedEnumeration; + startOffset: SVGAnimatedLength; + TEXTPATH_METHODTYPE_ALIGN: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTextPathElement: { + prototype: SVGTextPathElement; + new(): SVGTextPathElement; + TEXTPATH_METHODTYPE_ALIGN: number; + TEXTPATH_METHODTYPE_STRETCH: number; + TEXTPATH_METHODTYPE_UNKNOWN: number; + TEXTPATH_SPACINGTYPE_AUTO: number; + TEXTPATH_SPACINGTYPE_EXACT: number; + TEXTPATH_SPACINGTYPE_UNKNOWN: number; +} + +interface SVGTextPositioningElement extends SVGTextContentElement { + dx: SVGAnimatedLengthList; + dy: SVGAnimatedLengthList; + rotate: SVGAnimatedNumberList; + x: SVGAnimatedLengthList; + y: SVGAnimatedLengthList; +} + +declare var SVGTextPositioningElement: { + prototype: SVGTextPositioningElement; + new(): SVGTextPositioningElement; +} + +interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGTitleElement: { + prototype: SVGTitleElement; + new(): SVGTitleElement; +} + +interface SVGTransform { + angle: number; + matrix: SVGMatrix; + type: number; + setMatrix(matrix: SVGMatrix): void; + setRotate(angle: number, cx: number, cy: number): void; + setScale(sx: number, sy: number): void; + setSkewX(angle: number): void; + setSkewY(angle: number): void; + setTranslate(tx: number, ty: number): void; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_SKEWY: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_UNKNOWN: number; +} + +declare var SVGTransform: { + prototype: SVGTransform; + new(): SVGTransform; + SVG_TRANSFORM_MATRIX: number; + SVG_TRANSFORM_ROTATE: number; + SVG_TRANSFORM_SCALE: number; + SVG_TRANSFORM_SKEWX: number; + SVG_TRANSFORM_SKEWY: number; + SVG_TRANSFORM_TRANSLATE: number; + SVG_TRANSFORM_UNKNOWN: number; +} + +interface SVGTransformList { + numberOfItems: number; + appendItem(newItem: SVGTransform): SVGTransform; + clear(): void; + consolidate(): SVGTransform; + createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; + getItem(index: number): SVGTransform; + initialize(newItem: SVGTransform): SVGTransform; + insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; + removeItem(index: number): SVGTransform; + replaceItem(newItem: SVGTransform, index: number): SVGTransform; +} + +declare var SVGTransformList: { + prototype: SVGTransformList; + new(): SVGTransformList; +} + +interface SVGUnitTypes { + SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; + SVG_UNIT_TYPE_UNKNOWN: number; + SVG_UNIT_TYPE_USERSPACEONUSE: number; +} +declare var SVGUnitTypes: SVGUnitTypes; + +interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGTests, SVGLangSpace, SVGExternalResourcesRequired, SVGURIReference { + animatedInstanceRoot: SVGElementInstance; + height: SVGAnimatedLength; + instanceRoot: SVGElementInstance; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGUseElement: { + prototype: SVGUseElement; + new(): SVGUseElement; +} + +interface SVGViewElement extends SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan { + viewTarget: SVGStringList; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var SVGViewElement: { + prototype: SVGViewElement; + new(): SVGViewElement; +} + +interface SVGZoomAndPan { + SVG_ZOOMANDPAN_DISABLE: number; + SVG_ZOOMANDPAN_MAGNIFY: number; + SVG_ZOOMANDPAN_UNKNOWN: number; +} +declare var SVGZoomAndPan: SVGZoomAndPan; + +interface SVGZoomEvent extends UIEvent { + newScale: number; + newTranslate: SVGPoint; + previousScale: number; + previousTranslate: SVGPoint; + zoomRectScreen: SVGRect; +} + +declare var SVGZoomEvent: { + prototype: SVGZoomEvent; + new(): SVGZoomEvent; +} + +interface Screen extends EventTarget { + availHeight: number; + availWidth: number; + bufferDepth: number; + colorDepth: number; + deviceXDPI: number; + deviceYDPI: number; + fontSmoothingEnabled: boolean; + height: number; + logicalXDPI: number; + logicalYDPI: number; + msOrientation: string; + onmsorientationchange: (ev: Event) => any; + pixelDepth: number; + systemXDPI: number; + systemYDPI: number; + width: number; + msLockOrientation(orientations: string): boolean; + msLockOrientation(orientations: string[]): boolean; + msUnlockOrientation(): void; + addEventListener(type: "MSOrientationChange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Screen: { + prototype: Screen; + new(): Screen; +} + +interface ScriptNotifyEvent extends Event { + callingUri: string; + value: string; +} + +declare var ScriptNotifyEvent: { + prototype: ScriptNotifyEvent; + new(): ScriptNotifyEvent; +} + +interface ScriptProcessorNode extends AudioNode { + bufferSize: number; + onaudioprocess: (ev: AudioProcessingEvent) => any; + addEventListener(type: "audioprocess", listener: (ev: AudioProcessingEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var ScriptProcessorNode: { + prototype: ScriptProcessorNode; + new(): ScriptProcessorNode; +} + +interface Selection { + anchorNode: Node; + anchorOffset: number; + focusNode: Node; + focusOffset: number; + isCollapsed: boolean; + rangeCount: number; + type: string; + addRange(range: Range): void; + collapse(parentNode: Node, offset: number): void; + collapseToEnd(): void; + collapseToStart(): void; + containsNode(node: Node, partlyContained: boolean): boolean; + deleteFromDocument(): void; + empty(): void; + extend(newNode: Node, offset: number): void; + getRangeAt(index: number): Range; + removeAllRanges(): void; + removeRange(range: Range): void; + selectAllChildren(parentNode: Node): void; + setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void; + toString(): string; +} + +declare var Selection: { + prototype: Selection; + new(): Selection; +} + +interface SourceBuffer extends EventTarget { + appendWindowEnd: number; + appendWindowStart: number; + audioTracks: AudioTrackList; + buffered: TimeRanges; + mode: string; + timestampOffset: number; + updating: boolean; + videoTracks: VideoTrackList; + abort(): void; + appendBuffer(data: ArrayBuffer): void; + appendBuffer(data: ArrayBufferView): void; + appendStream(stream: MSStream, maxSize?: number): void; + remove(start: number, end: number): void; +} + +declare var SourceBuffer: { + prototype: SourceBuffer; + new(): SourceBuffer; +} + +interface SourceBufferList extends EventTarget { + length: number; + item(index: number): SourceBuffer; + [index: number]: SourceBuffer; +} + +declare var SourceBufferList: { + prototype: SourceBufferList; + new(): SourceBufferList; +} + +interface StereoPannerNode extends AudioNode { + pan: AudioParam; +} + +declare var StereoPannerNode: { + prototype: StereoPannerNode; + new(): StereoPannerNode; +} + +interface Storage { + length: number; + clear(): void; + getItem(key: string): any; + key(index: number): string; + removeItem(key: string): void; + setItem(key: string, data: string): void; + [key: string]: any; + [index: number]: string; +} + +declare var Storage: { + prototype: Storage; + new(): Storage; +} + +interface StorageEvent extends Event { + key: string; + newValue: any; + oldValue: any; + storageArea: Storage; + url: string; + initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; +} + +declare var StorageEvent: { + prototype: StorageEvent; + new(): StorageEvent; +} + +interface StyleMedia { + type: string; + matchMedium(mediaquery: string): boolean; +} + +declare var StyleMedia: { + prototype: StyleMedia; + new(): StyleMedia; +} + +interface StyleSheet { + disabled: boolean; + href: string; + media: MediaList; + ownerNode: Node; + parentStyleSheet: StyleSheet; + title: string; + type: string; +} + +declare var StyleSheet: { + prototype: StyleSheet; + new(): StyleSheet; +} + +interface StyleSheetList { + length: number; + item(index?: number): StyleSheet; + [index: number]: StyleSheet; +} + +declare var StyleSheetList: { + prototype: StyleSheetList; + new(): StyleSheetList; +} + +interface StyleSheetPageList { + length: number; + item(index: number): CSSPageRule; + [index: number]: CSSPageRule; +} + +declare var StyleSheetPageList: { + prototype: StyleSheetPageList; + new(): StyleSheetPageList; +} + +interface SubtleCrypto { + decrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + decrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + deriveBits(algorithm: string, baseKey: CryptoKey, length: number): any; + deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: number): any; + deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: string, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: string, extractable: boolean, keyUsages: string[]): any; + deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Algorithm, extractable: boolean, keyUsages: string[]): any; + digest(algorithm: string, data: ArrayBufferView): any; + digest(algorithm: Algorithm, data: ArrayBufferView): any; + encrypt(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + encrypt(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + exportKey(format: string, key: CryptoKey): any; + generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): any; + generateKey(algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: string, extractable: boolean, keyUsages: string[]): any; + importKey(format: string, keyData: ArrayBufferView, algorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + sign(algorithm: string, key: CryptoKey, data: ArrayBufferView): any; + sign(algorithm: Algorithm, key: CryptoKey, data: ArrayBufferView): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: string, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: string, extractable: boolean, keyUsages: string[]): any; + unwrapKey(format: string, wrappedKey: ArrayBufferView, unwrappingKey: CryptoKey, unwrapAlgorithm: Algorithm, unwrappedKeyAlgorithm: Algorithm, extractable: boolean, keyUsages: string[]): any; + verify(algorithm: string, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; + verify(algorithm: Algorithm, key: CryptoKey, signature: ArrayBufferView, data: ArrayBufferView): any; + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string): any; + wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): any; +} + +declare var SubtleCrypto: { + prototype: SubtleCrypto; + new(): SubtleCrypto; +} + +interface Text extends CharacterData { + wholeText: string; + replaceWholeText(content: string): Text; + splitText(offset: number): Text; +} + +declare var Text: { + prototype: Text; + new(): Text; +} + +interface TextEvent extends UIEvent { + data: string; + inputMethod: number; + locale: string; + initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_MULTIMODAL: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_VOICE: number; +} + +declare var TextEvent: { + prototype: TextEvent; + new(): TextEvent; + DOM_INPUT_METHOD_DROP: number; + DOM_INPUT_METHOD_HANDWRITING: number; + DOM_INPUT_METHOD_IME: number; + DOM_INPUT_METHOD_KEYBOARD: number; + DOM_INPUT_METHOD_MULTIMODAL: number; + DOM_INPUT_METHOD_OPTION: number; + DOM_INPUT_METHOD_PASTE: number; + DOM_INPUT_METHOD_SCRIPT: number; + DOM_INPUT_METHOD_UNKNOWN: number; + DOM_INPUT_METHOD_VOICE: number; +} + +interface TextMetrics { + width: number; +} + +declare var TextMetrics: { + prototype: TextMetrics; + new(): TextMetrics; +} + +interface TextRange { + boundingHeight: number; + boundingLeft: number; + boundingTop: number; + boundingWidth: number; + htmlText: string; + offsetLeft: number; + offsetTop: number; + text: string; + collapse(start?: boolean): void; + compareEndPoints(how: string, sourceRange: TextRange): number; + duplicate(): TextRange; + execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; + execCommandShowHelp(cmdID: string): boolean; + expand(Unit: string): boolean; + findText(string: string, count?: number, flags?: number): boolean; + getBookmark(): string; + getBoundingClientRect(): ClientRect; + getClientRects(): ClientRectList; + inRange(range: TextRange): boolean; + isEqual(range: TextRange): boolean; + move(unit: string, count?: number): number; + moveEnd(unit: string, count?: number): number; + moveStart(unit: string, count?: number): number; + moveToBookmark(bookmark: string): boolean; + moveToElementText(element: Element): void; + moveToPoint(x: number, y: number): void; + parentElement(): Element; + pasteHTML(html: string): void; + queryCommandEnabled(cmdID: string): boolean; + queryCommandIndeterm(cmdID: string): boolean; + queryCommandState(cmdID: string): boolean; + queryCommandSupported(cmdID: string): boolean; + queryCommandText(cmdID: string): string; + queryCommandValue(cmdID: string): any; + scrollIntoView(fStart?: boolean): void; + select(): void; + setEndPoint(how: string, SourceRange: TextRange): void; +} + +declare var TextRange: { + prototype: TextRange; + new(): TextRange; +} + +interface TextRangeCollection { + length: number; + item(index: number): TextRange; + [index: number]: TextRange; +} + +declare var TextRangeCollection: { + prototype: TextRangeCollection; + new(): TextRangeCollection; +} + +interface TextTrack extends EventTarget { + activeCues: TextTrackCueList; + cues: TextTrackCueList; + inBandMetadataTrackDispatchType: string; + kind: string; + label: string; + language: string; + mode: any; + oncuechange: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + readyState: number; + addCue(cue: TextTrackCue): void; + removeCue(cue: TextTrackCue): void; + DISABLED: number; + ERROR: number; + HIDDEN: number; + LOADED: number; + LOADING: number; + NONE: number; + SHOWING: number; + addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var TextTrack: { + prototype: TextTrack; + new(): TextTrack; + DISABLED: number; + ERROR: number; + HIDDEN: number; + LOADED: number; + LOADING: number; + NONE: number; + SHOWING: number; +} + +interface TextTrackCue extends EventTarget { + endTime: number; + id: string; + onenter: (ev: Event) => any; + onexit: (ev: Event) => any; + pauseOnExit: boolean; + startTime: number; + text: string; + track: TextTrack; + getCueAsHTML(): DocumentFragment; + addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var TextTrackCue: { + prototype: TextTrackCue; + new(startTime: number, endTime: number, text: string): TextTrackCue; +} + +interface TextTrackCueList { + length: number; + getCueById(id: string): TextTrackCue; + item(index: number): TextTrackCue; + [index: number]: TextTrackCue; +} + +declare var TextTrackCueList: { + prototype: TextTrackCueList; + new(): TextTrackCueList; +} + +interface TextTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + item(index: number): TextTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: TextTrack; +} + +declare var TextTrackList: { + prototype: TextTrackList; + new(): TextTrackList; +} + +interface TimeRanges { + length: number; + end(index: number): number; + start(index: number): number; +} + +declare var TimeRanges: { + prototype: TimeRanges; + new(): TimeRanges; +} + +interface Touch { + clientX: number; + clientY: number; + identifier: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; + target: EventTarget; +} + +declare var Touch: { + prototype: Touch; + new(): Touch; +} + +interface TouchEvent extends UIEvent { + altKey: boolean; + changedTouches: TouchList; + ctrlKey: boolean; + metaKey: boolean; + shiftKey: boolean; + targetTouches: TouchList; + touches: TouchList; +} + +declare var TouchEvent: { + prototype: TouchEvent; + new(): TouchEvent; +} + +interface TouchList { + length: number; + item(index: number): Touch; + [index: number]: Touch; +} + +declare var TouchList: { + prototype: TouchList; + new(): TouchList; +} + +interface TrackEvent extends Event { + track: any; +} + +declare var TrackEvent: { + prototype: TrackEvent; + new(): TrackEvent; +} + +interface TransitionEvent extends Event { + elapsedTime: number; + propertyName: string; + initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; +} + +declare var TransitionEvent: { + prototype: TransitionEvent; + new(): TransitionEvent; +} + +interface TreeWalker { + currentNode: Node; + expandEntityReferences: boolean; + filter: NodeFilter; + root: Node; + whatToShow: number; + firstChild(): Node; + lastChild(): Node; + nextNode(): Node; + nextSibling(): Node; + parentNode(): Node; + previousNode(): Node; + previousSibling(): Node; +} + +declare var TreeWalker: { + prototype: TreeWalker; + new(): TreeWalker; +} + +interface UIEvent extends Event { + detail: number; + view: Window; + initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; +} + +declare var UIEvent: { + prototype: UIEvent; + new(type: string, eventInitDict?: UIEventInit): UIEvent; +} + +interface URL { + createObjectURL(object: any, options?: ObjectURLOptions): string; + revokeObjectURL(url: string): void; +} +declare var URL: URL; + +interface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer { + mediaType: string; +} + +declare var UnviewableContentIdentifiedEvent: { + prototype: UnviewableContentIdentifiedEvent; + new(): UnviewableContentIdentifiedEvent; +} + +interface ValidityState { + badInput: boolean; + customError: boolean; + patternMismatch: boolean; + rangeOverflow: boolean; + rangeUnderflow: boolean; + stepMismatch: boolean; + tooLong: boolean; + typeMismatch: boolean; + valid: boolean; + valueMissing: boolean; +} + +declare var ValidityState: { + prototype: ValidityState; + new(): ValidityState; +} + +interface VideoPlaybackQuality { + corruptedVideoFrames: number; + creationTime: number; + droppedVideoFrames: number; + totalFrameDelay: number; + totalVideoFrames: number; +} + +declare var VideoPlaybackQuality: { + prototype: VideoPlaybackQuality; + new(): VideoPlaybackQuality; +} + +interface VideoTrack { + id: string; + kind: string; + label: string; + language: string; + selected: boolean; + sourceBuffer: SourceBuffer; +} + +declare var VideoTrack: { + prototype: VideoTrack; + new(): VideoTrack; +} + +interface VideoTrackList extends EventTarget { + length: number; + onaddtrack: (ev: TrackEvent) => any; + onchange: (ev: Event) => any; + onremovetrack: (ev: TrackEvent) => any; + selectedIndex: number; + getTrackById(id: string): VideoTrack; + item(index: number): VideoTrack; + addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "removetrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: VideoTrack; +} + +declare var VideoTrackList: { + prototype: VideoTrackList; + new(): VideoTrackList; +} + +interface WEBGL_compressed_texture_s3tc { + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +declare var WEBGL_compressed_texture_s3tc: { + prototype: WEBGL_compressed_texture_s3tc; + new(): WEBGL_compressed_texture_s3tc; + COMPRESSED_RGBA_S3TC_DXT1_EXT: number; + COMPRESSED_RGBA_S3TC_DXT3_EXT: number; + COMPRESSED_RGBA_S3TC_DXT5_EXT: number; + COMPRESSED_RGB_S3TC_DXT1_EXT: number; +} + +interface WEBGL_debug_renderer_info { + UNMASKED_RENDERER_WEBGL: number; + UNMASKED_VENDOR_WEBGL: number; +} + +declare var WEBGL_debug_renderer_info: { + prototype: WEBGL_debug_renderer_info; + new(): WEBGL_debug_renderer_info; + UNMASKED_RENDERER_WEBGL: number; + UNMASKED_VENDOR_WEBGL: number; +} + +interface WEBGL_depth_texture { + UNSIGNED_INT_24_8_WEBGL: number; +} + +declare var WEBGL_depth_texture: { + prototype: WEBGL_depth_texture; + new(): WEBGL_depth_texture; + UNSIGNED_INT_24_8_WEBGL: number; +} + +interface WaveShaperNode extends AudioNode { + curve: any; + oversample: string; +} + +declare var WaveShaperNode: { + prototype: WaveShaperNode; + new(): WaveShaperNode; +} + +interface WebGLActiveInfo { + name: string; + size: number; + type: number; +} + +declare var WebGLActiveInfo: { + prototype: WebGLActiveInfo; + new(): WebGLActiveInfo; +} + +interface WebGLBuffer extends WebGLObject { +} + +declare var WebGLBuffer: { + prototype: WebGLBuffer; + new(): WebGLBuffer; +} + +interface WebGLContextEvent extends Event { + statusMessage: string; +} + +declare var WebGLContextEvent: { + prototype: WebGLContextEvent; + new(): WebGLContextEvent; +} + +interface WebGLFramebuffer extends WebGLObject { +} + +declare var WebGLFramebuffer: { + prototype: WebGLFramebuffer; + new(): WebGLFramebuffer; +} + +interface WebGLObject { +} + +declare var WebGLObject: { + prototype: WebGLObject; + new(): WebGLObject; +} + +interface WebGLProgram extends WebGLObject { +} + +declare var WebGLProgram: { + prototype: WebGLProgram; + new(): WebGLProgram; +} + +interface WebGLRenderbuffer extends WebGLObject { +} + +declare var WebGLRenderbuffer: { + prototype: WebGLRenderbuffer; + new(): WebGLRenderbuffer; +} + +interface WebGLRenderingContext { + canvas: HTMLCanvasElement; + drawingBufferHeight: number; + drawingBufferWidth: number; + activeTexture(texture: number): void; + attachShader(program: WebGLProgram, shader: WebGLShader): void; + bindAttribLocation(program: WebGLProgram, index: number, name: string): void; + bindBuffer(target: number, buffer: WebGLBuffer): void; + bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; + bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; + bindTexture(target: number, texture: WebGLTexture): void; + blendColor(red: number, green: number, blue: number, alpha: number): void; + blendEquation(mode: number): void; + blendEquationSeparate(modeRGB: number, modeAlpha: number): void; + blendFunc(sfactor: number, dfactor: number): void; + blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; + bufferData(target: number, size: number, usage: number): void; + bufferData(target: number, size: ArrayBufferView, usage: number): void; + bufferData(target: number, size: any, usage: number): void; + bufferSubData(target: number, offset: number, data: ArrayBufferView): void; + bufferSubData(target: number, offset: number, data: any): void; + checkFramebufferStatus(target: number): number; + clear(mask: number): void; + clearColor(red: number, green: number, blue: number, alpha: number): void; + clearDepth(depth: number): void; + clearStencil(s: number): void; + colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; + compileShader(shader: WebGLShader): void; + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; + copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; + copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; + createBuffer(): WebGLBuffer; + createFramebuffer(): WebGLFramebuffer; + createProgram(): WebGLProgram; + createRenderbuffer(): WebGLRenderbuffer; + createShader(type: number): WebGLShader; + createTexture(): WebGLTexture; + cullFace(mode: number): void; + deleteBuffer(buffer: WebGLBuffer): void; + deleteFramebuffer(framebuffer: WebGLFramebuffer): void; + deleteProgram(program: WebGLProgram): void; + deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; + deleteShader(shader: WebGLShader): void; + deleteTexture(texture: WebGLTexture): void; + depthFunc(func: number): void; + depthMask(flag: boolean): void; + depthRange(zNear: number, zFar: number): void; + detachShader(program: WebGLProgram, shader: WebGLShader): void; + disable(cap: number): void; + disableVertexAttribArray(index: number): void; + drawArrays(mode: number, first: number, count: number): void; + drawElements(mode: number, count: number, type: number, offset: number): void; + enable(cap: number): void; + enableVertexAttribArray(index: number): void; + finish(): void; + flush(): void; + framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; + framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; + frontFace(mode: number): void; + generateMipmap(target: number): void; + getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; + getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; + getAttachedShaders(program: WebGLProgram): WebGLShader[]; + getAttribLocation(program: WebGLProgram, name: string): number; + getBufferParameter(target: number, pname: number): any; + getContextAttributes(): WebGLContextAttributes; + getError(): number; + getExtension(name: string): any; + getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; + getParameter(pname: number): any; + getProgramInfoLog(program: WebGLProgram): string; + getProgramParameter(program: WebGLProgram, pname: number): any; + getRenderbufferParameter(target: number, pname: number): any; + getShaderInfoLog(shader: WebGLShader): string; + getShaderParameter(shader: WebGLShader, pname: number): any; + getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; + getShaderSource(shader: WebGLShader): string; + getSupportedExtensions(): string[]; + getTexParameter(target: number, pname: number): any; + getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; + getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; + getVertexAttrib(index: number, pname: number): any; + getVertexAttribOffset(index: number, pname: number): number; + hint(target: number, mode: number): void; + isBuffer(buffer: WebGLBuffer): boolean; + isContextLost(): boolean; + isEnabled(cap: number): boolean; + isFramebuffer(framebuffer: WebGLFramebuffer): boolean; + isProgram(program: WebGLProgram): boolean; + isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; + isShader(shader: WebGLShader): boolean; + isTexture(texture: WebGLTexture): boolean; + lineWidth(width: number): void; + linkProgram(program: WebGLProgram): void; + pixelStorei(pname: number, param: number): void; + polygonOffset(factor: number, units: number): void; + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; + renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; + sampleCoverage(value: number, invert: boolean): void; + scissor(x: number, y: number, width: number, height: number): void; + shaderSource(shader: WebGLShader, source: string): void; + stencilFunc(func: number, ref: number, mask: number): void; + stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; + stencilMask(mask: number): void; + stencilMaskSeparate(face: number, mask: number): void; + stencilOp(fail: number, zfail: number, zpass: number): void; + stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; + texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; + texParameterf(target: number, pname: number, param: number): void; + texParameteri(target: number, pname: number, param: number): void; + texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; + uniform1f(location: WebGLUniformLocation, x: number): void; + uniform1fv(location: WebGLUniformLocation, v: any): void; + uniform1i(location: WebGLUniformLocation, x: number): void; + uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform2f(location: WebGLUniformLocation, x: number, y: number): void; + uniform2fv(location: WebGLUniformLocation, v: any): void; + uniform2i(location: WebGLUniformLocation, x: number, y: number): void; + uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; + uniform3fv(location: WebGLUniformLocation, v: any): void; + uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; + uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; + uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + uniform4fv(location: WebGLUniformLocation, v: any): void; + uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; + uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; + uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: any): void; + useProgram(program: WebGLProgram): void; + validateProgram(program: WebGLProgram): void; + vertexAttrib1f(indx: number, x: number): void; + vertexAttrib1fv(indx: number, values: any): void; + vertexAttrib2f(indx: number, x: number, y: number): void; + vertexAttrib2fv(indx: number, values: any): void; + vertexAttrib3f(indx: number, x: number, y: number, z: number): void; + vertexAttrib3fv(indx: number, values: any): void; + vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; + vertexAttrib4fv(indx: number, values: any): void; + vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; + viewport(x: number, y: number, width: number, height: number): void; + ACTIVE_ATTRIBUTES: number; + ACTIVE_TEXTURE: number; + ACTIVE_UNIFORMS: number; + ALIASED_LINE_WIDTH_RANGE: number; + ALIASED_POINT_SIZE_RANGE: number; + ALPHA: number; + ALPHA_BITS: number; + ALWAYS: number; + ARRAY_BUFFER: number; + ARRAY_BUFFER_BINDING: number; + ATTACHED_SHADERS: number; + BACK: number; + BLEND: number; + BLEND_COLOR: number; + BLEND_DST_ALPHA: number; + BLEND_DST_RGB: number; + BLEND_EQUATION: number; + BLEND_EQUATION_ALPHA: number; + BLEND_EQUATION_RGB: number; + BLEND_SRC_ALPHA: number; + BLEND_SRC_RGB: number; + BLUE_BITS: number; + BOOL: number; + BOOL_VEC2: number; + BOOL_VEC3: number; + BOOL_VEC4: number; + BROWSER_DEFAULT_WEBGL: number; + BUFFER_SIZE: number; + BUFFER_USAGE: number; + BYTE: number; + CCW: number; + CLAMP_TO_EDGE: number; + COLOR_ATTACHMENT0: number; + COLOR_BUFFER_BIT: number; + COLOR_CLEAR_VALUE: number; + COLOR_WRITEMASK: number; + COMPILE_STATUS: number; + COMPRESSED_TEXTURE_FORMATS: number; + CONSTANT_ALPHA: number; + CONSTANT_COLOR: number; + CONTEXT_LOST_WEBGL: number; + CULL_FACE: number; + CULL_FACE_MODE: number; + CURRENT_PROGRAM: number; + CURRENT_VERTEX_ATTRIB: number; + CW: number; + DECR: number; + DECR_WRAP: number; + DELETE_STATUS: number; + DEPTH_ATTACHMENT: number; + DEPTH_BITS: number; + DEPTH_BUFFER_BIT: number; + DEPTH_CLEAR_VALUE: number; + DEPTH_COMPONENT: number; + DEPTH_COMPONENT16: number; + DEPTH_FUNC: number; + DEPTH_RANGE: number; + DEPTH_STENCIL: number; + DEPTH_STENCIL_ATTACHMENT: number; + DEPTH_TEST: number; + DEPTH_WRITEMASK: number; + DITHER: number; + DONT_CARE: number; + DST_ALPHA: number; + DST_COLOR: number; + DYNAMIC_DRAW: number; + ELEMENT_ARRAY_BUFFER: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + EQUAL: number; + FASTEST: number; + FLOAT: number; + FLOAT_MAT2: number; + FLOAT_MAT3: number; + FLOAT_MAT4: number; + FLOAT_VEC2: number; + FLOAT_VEC3: number; + FLOAT_VEC4: number; + FRAGMENT_SHADER: number; + FRAMEBUFFER: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + FRAMEBUFFER_BINDING: number; + FRAMEBUFFER_COMPLETE: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + FRAMEBUFFER_UNSUPPORTED: number; + FRONT: number; + FRONT_AND_BACK: number; + FRONT_FACE: number; + FUNC_ADD: number; + FUNC_REVERSE_SUBTRACT: number; + FUNC_SUBTRACT: number; + GENERATE_MIPMAP_HINT: number; + GEQUAL: number; + GREATER: number; + GREEN_BITS: number; + HIGH_FLOAT: number; + HIGH_INT: number; + IMPLEMENTATION_COLOR_READ_FORMAT: number; + IMPLEMENTATION_COLOR_READ_TYPE: number; + INCR: number; + INCR_WRAP: number; + INT: number; + INT_VEC2: number; + INT_VEC3: number; + INT_VEC4: number; + INVALID_ENUM: number; + INVALID_FRAMEBUFFER_OPERATION: number; + INVALID_OPERATION: number; + INVALID_VALUE: number; + INVERT: number; + KEEP: number; + LEQUAL: number; + LESS: number; + LINEAR: number; + LINEAR_MIPMAP_LINEAR: number; + LINEAR_MIPMAP_NEAREST: number; + LINES: number; + LINE_LOOP: number; + LINE_STRIP: number; + LINE_WIDTH: number; + LINK_STATUS: number; + LOW_FLOAT: number; + LOW_INT: number; + LUMINANCE: number; + LUMINANCE_ALPHA: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + MAX_RENDERBUFFER_SIZE: number; + MAX_TEXTURE_IMAGE_UNITS: number; + MAX_TEXTURE_SIZE: number; + MAX_VARYING_VECTORS: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + MAX_VIEWPORT_DIMS: number; + MEDIUM_FLOAT: number; + MEDIUM_INT: number; + MIRRORED_REPEAT: number; + NEAREST: number; + NEAREST_MIPMAP_LINEAR: number; + NEAREST_MIPMAP_NEAREST: number; + NEVER: number; + NICEST: number; + NONE: number; + NOTEQUAL: number; + NO_ERROR: number; + ONE: number; + ONE_MINUS_CONSTANT_ALPHA: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_DST_ALPHA: number; + ONE_MINUS_DST_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + ONE_MINUS_SRC_COLOR: number; + OUT_OF_MEMORY: number; + PACK_ALIGNMENT: number; + POINTS: number; + POLYGON_OFFSET_FACTOR: number; + POLYGON_OFFSET_FILL: number; + POLYGON_OFFSET_UNITS: number; + RED_BITS: number; + RENDERBUFFER: number; + RENDERBUFFER_ALPHA_SIZE: number; + RENDERBUFFER_BINDING: number; + RENDERBUFFER_BLUE_SIZE: number; + RENDERBUFFER_DEPTH_SIZE: number; + RENDERBUFFER_GREEN_SIZE: number; + RENDERBUFFER_HEIGHT: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + RENDERBUFFER_RED_SIZE: number; + RENDERBUFFER_STENCIL_SIZE: number; + RENDERBUFFER_WIDTH: number; + RENDERER: number; + REPEAT: number; + REPLACE: number; + RGB: number; + RGB565: number; + RGB5_A1: number; + RGBA: number; + RGBA4: number; + SAMPLER_2D: number; + SAMPLER_CUBE: number; + SAMPLES: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + SAMPLE_BUFFERS: number; + SAMPLE_COVERAGE: number; + SAMPLE_COVERAGE_INVERT: number; + SAMPLE_COVERAGE_VALUE: number; + SCISSOR_BOX: number; + SCISSOR_TEST: number; + SHADER_TYPE: number; + SHADING_LANGUAGE_VERSION: number; + SHORT: number; + SRC_ALPHA: number; + SRC_ALPHA_SATURATE: number; + SRC_COLOR: number; + STATIC_DRAW: number; + STENCIL_ATTACHMENT: number; + STENCIL_BACK_FAIL: number; + STENCIL_BACK_FUNC: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + STENCIL_BACK_REF: number; + STENCIL_BACK_VALUE_MASK: number; + STENCIL_BACK_WRITEMASK: number; + STENCIL_BITS: number; + STENCIL_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + STENCIL_FAIL: number; + STENCIL_FUNC: number; + STENCIL_INDEX: number; + STENCIL_INDEX8: number; + STENCIL_PASS_DEPTH_FAIL: number; + STENCIL_PASS_DEPTH_PASS: number; + STENCIL_REF: number; + STENCIL_TEST: number; + STENCIL_VALUE_MASK: number; + STENCIL_WRITEMASK: number; + STREAM_DRAW: number; + SUBPIXEL_BITS: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE1: number; + TEXTURE10: number; + TEXTURE11: number; + TEXTURE12: number; + TEXTURE13: number; + TEXTURE14: number; + TEXTURE15: number; + TEXTURE16: number; + TEXTURE17: number; + TEXTURE18: number; + TEXTURE19: number; + TEXTURE2: number; + TEXTURE20: number; + TEXTURE21: number; + TEXTURE22: number; + TEXTURE23: number; + TEXTURE24: number; + TEXTURE25: number; + TEXTURE26: number; + TEXTURE27: number; + TEXTURE28: number; + TEXTURE29: number; + TEXTURE3: number; + TEXTURE30: number; + TEXTURE31: number; + TEXTURE4: number; + TEXTURE5: number; + TEXTURE6: number; + TEXTURE7: number; + TEXTURE8: number; + TEXTURE9: number; + TEXTURE_2D: number; + TEXTURE_BINDING_2D: number; + TEXTURE_BINDING_CUBE_MAP: number; + TEXTURE_CUBE_MAP: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + TEXTURE_MAG_FILTER: number; + TEXTURE_MIN_FILTER: number; + TEXTURE_WRAP_S: number; + TEXTURE_WRAP_T: number; + TRIANGLES: number; + TRIANGLE_FAN: number; + TRIANGLE_STRIP: number; + UNPACK_ALIGNMENT: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + UNPACK_FLIP_Y_WEBGL: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + UNSIGNED_BYTE: number; + UNSIGNED_INT: number; + UNSIGNED_SHORT: number; + UNSIGNED_SHORT_4_4_4_4: number; + UNSIGNED_SHORT_5_5_5_1: number; + UNSIGNED_SHORT_5_6_5: number; + VALIDATE_STATUS: number; + VENDOR: number; + VERSION: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + VERTEX_SHADER: number; + VIEWPORT: number; + ZERO: number; +} + +declare var WebGLRenderingContext: { + prototype: WebGLRenderingContext; + new(): WebGLRenderingContext; + ACTIVE_ATTRIBUTES: number; + ACTIVE_TEXTURE: number; + ACTIVE_UNIFORMS: number; + ALIASED_LINE_WIDTH_RANGE: number; + ALIASED_POINT_SIZE_RANGE: number; + ALPHA: number; + ALPHA_BITS: number; + ALWAYS: number; + ARRAY_BUFFER: number; + ARRAY_BUFFER_BINDING: number; + ATTACHED_SHADERS: number; + BACK: number; + BLEND: number; + BLEND_COLOR: number; + BLEND_DST_ALPHA: number; + BLEND_DST_RGB: number; + BLEND_EQUATION: number; + BLEND_EQUATION_ALPHA: number; + BLEND_EQUATION_RGB: number; + BLEND_SRC_ALPHA: number; + BLEND_SRC_RGB: number; + BLUE_BITS: number; + BOOL: number; + BOOL_VEC2: number; + BOOL_VEC3: number; + BOOL_VEC4: number; + BROWSER_DEFAULT_WEBGL: number; + BUFFER_SIZE: number; + BUFFER_USAGE: number; + BYTE: number; + CCW: number; + CLAMP_TO_EDGE: number; + COLOR_ATTACHMENT0: number; + COLOR_BUFFER_BIT: number; + COLOR_CLEAR_VALUE: number; + COLOR_WRITEMASK: number; + COMPILE_STATUS: number; + COMPRESSED_TEXTURE_FORMATS: number; + CONSTANT_ALPHA: number; + CONSTANT_COLOR: number; + CONTEXT_LOST_WEBGL: number; + CULL_FACE: number; + CULL_FACE_MODE: number; + CURRENT_PROGRAM: number; + CURRENT_VERTEX_ATTRIB: number; + CW: number; + DECR: number; + DECR_WRAP: number; + DELETE_STATUS: number; + DEPTH_ATTACHMENT: number; + DEPTH_BITS: number; + DEPTH_BUFFER_BIT: number; + DEPTH_CLEAR_VALUE: number; + DEPTH_COMPONENT: number; + DEPTH_COMPONENT16: number; + DEPTH_FUNC: number; + DEPTH_RANGE: number; + DEPTH_STENCIL: number; + DEPTH_STENCIL_ATTACHMENT: number; + DEPTH_TEST: number; + DEPTH_WRITEMASK: number; + DITHER: number; + DONT_CARE: number; + DST_ALPHA: number; + DST_COLOR: number; + DYNAMIC_DRAW: number; + ELEMENT_ARRAY_BUFFER: number; + ELEMENT_ARRAY_BUFFER_BINDING: number; + EQUAL: number; + FASTEST: number; + FLOAT: number; + FLOAT_MAT2: number; + FLOAT_MAT3: number; + FLOAT_MAT4: number; + FLOAT_VEC2: number; + FLOAT_VEC3: number; + FLOAT_VEC4: number; + FRAGMENT_SHADER: number; + FRAMEBUFFER: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; + FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; + FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; + FRAMEBUFFER_BINDING: number; + FRAMEBUFFER_COMPLETE: number; + FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; + FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; + FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; + FRAMEBUFFER_UNSUPPORTED: number; + FRONT: number; + FRONT_AND_BACK: number; + FRONT_FACE: number; + FUNC_ADD: number; + FUNC_REVERSE_SUBTRACT: number; + FUNC_SUBTRACT: number; + GENERATE_MIPMAP_HINT: number; + GEQUAL: number; + GREATER: number; + GREEN_BITS: number; + HIGH_FLOAT: number; + HIGH_INT: number; + IMPLEMENTATION_COLOR_READ_FORMAT: number; + IMPLEMENTATION_COLOR_READ_TYPE: number; + INCR: number; + INCR_WRAP: number; + INT: number; + INT_VEC2: number; + INT_VEC3: number; + INT_VEC4: number; + INVALID_ENUM: number; + INVALID_FRAMEBUFFER_OPERATION: number; + INVALID_OPERATION: number; + INVALID_VALUE: number; + INVERT: number; + KEEP: number; + LEQUAL: number; + LESS: number; + LINEAR: number; + LINEAR_MIPMAP_LINEAR: number; + LINEAR_MIPMAP_NEAREST: number; + LINES: number; + LINE_LOOP: number; + LINE_STRIP: number; + LINE_WIDTH: number; + LINK_STATUS: number; + LOW_FLOAT: number; + LOW_INT: number; + LUMINANCE: number; + LUMINANCE_ALPHA: number; + MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; + MAX_CUBE_MAP_TEXTURE_SIZE: number; + MAX_FRAGMENT_UNIFORM_VECTORS: number; + MAX_RENDERBUFFER_SIZE: number; + MAX_TEXTURE_IMAGE_UNITS: number; + MAX_TEXTURE_SIZE: number; + MAX_VARYING_VECTORS: number; + MAX_VERTEX_ATTRIBS: number; + MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; + MAX_VERTEX_UNIFORM_VECTORS: number; + MAX_VIEWPORT_DIMS: number; + MEDIUM_FLOAT: number; + MEDIUM_INT: number; + MIRRORED_REPEAT: number; + NEAREST: number; + NEAREST_MIPMAP_LINEAR: number; + NEAREST_MIPMAP_NEAREST: number; + NEVER: number; + NICEST: number; + NONE: number; + NOTEQUAL: number; + NO_ERROR: number; + ONE: number; + ONE_MINUS_CONSTANT_ALPHA: number; + ONE_MINUS_CONSTANT_COLOR: number; + ONE_MINUS_DST_ALPHA: number; + ONE_MINUS_DST_COLOR: number; + ONE_MINUS_SRC_ALPHA: number; + ONE_MINUS_SRC_COLOR: number; + OUT_OF_MEMORY: number; + PACK_ALIGNMENT: number; + POINTS: number; + POLYGON_OFFSET_FACTOR: number; + POLYGON_OFFSET_FILL: number; + POLYGON_OFFSET_UNITS: number; + RED_BITS: number; + RENDERBUFFER: number; + RENDERBUFFER_ALPHA_SIZE: number; + RENDERBUFFER_BINDING: number; + RENDERBUFFER_BLUE_SIZE: number; + RENDERBUFFER_DEPTH_SIZE: number; + RENDERBUFFER_GREEN_SIZE: number; + RENDERBUFFER_HEIGHT: number; + RENDERBUFFER_INTERNAL_FORMAT: number; + RENDERBUFFER_RED_SIZE: number; + RENDERBUFFER_STENCIL_SIZE: number; + RENDERBUFFER_WIDTH: number; + RENDERER: number; + REPEAT: number; + REPLACE: number; + RGB: number; + RGB565: number; + RGB5_A1: number; + RGBA: number; + RGBA4: number; + SAMPLER_2D: number; + SAMPLER_CUBE: number; + SAMPLES: number; + SAMPLE_ALPHA_TO_COVERAGE: number; + SAMPLE_BUFFERS: number; + SAMPLE_COVERAGE: number; + SAMPLE_COVERAGE_INVERT: number; + SAMPLE_COVERAGE_VALUE: number; + SCISSOR_BOX: number; + SCISSOR_TEST: number; + SHADER_TYPE: number; + SHADING_LANGUAGE_VERSION: number; + SHORT: number; + SRC_ALPHA: number; + SRC_ALPHA_SATURATE: number; + SRC_COLOR: number; + STATIC_DRAW: number; + STENCIL_ATTACHMENT: number; + STENCIL_BACK_FAIL: number; + STENCIL_BACK_FUNC: number; + STENCIL_BACK_PASS_DEPTH_FAIL: number; + STENCIL_BACK_PASS_DEPTH_PASS: number; + STENCIL_BACK_REF: number; + STENCIL_BACK_VALUE_MASK: number; + STENCIL_BACK_WRITEMASK: number; + STENCIL_BITS: number; + STENCIL_BUFFER_BIT: number; + STENCIL_CLEAR_VALUE: number; + STENCIL_FAIL: number; + STENCIL_FUNC: number; + STENCIL_INDEX: number; + STENCIL_INDEX8: number; + STENCIL_PASS_DEPTH_FAIL: number; + STENCIL_PASS_DEPTH_PASS: number; + STENCIL_REF: number; + STENCIL_TEST: number; + STENCIL_VALUE_MASK: number; + STENCIL_WRITEMASK: number; + STREAM_DRAW: number; + SUBPIXEL_BITS: number; + TEXTURE: number; + TEXTURE0: number; + TEXTURE1: number; + TEXTURE10: number; + TEXTURE11: number; + TEXTURE12: number; + TEXTURE13: number; + TEXTURE14: number; + TEXTURE15: number; + TEXTURE16: number; + TEXTURE17: number; + TEXTURE18: number; + TEXTURE19: number; + TEXTURE2: number; + TEXTURE20: number; + TEXTURE21: number; + TEXTURE22: number; + TEXTURE23: number; + TEXTURE24: number; + TEXTURE25: number; + TEXTURE26: number; + TEXTURE27: number; + TEXTURE28: number; + TEXTURE29: number; + TEXTURE3: number; + TEXTURE30: number; + TEXTURE31: number; + TEXTURE4: number; + TEXTURE5: number; + TEXTURE6: number; + TEXTURE7: number; + TEXTURE8: number; + TEXTURE9: number; + TEXTURE_2D: number; + TEXTURE_BINDING_2D: number; + TEXTURE_BINDING_CUBE_MAP: number; + TEXTURE_CUBE_MAP: number; + TEXTURE_CUBE_MAP_NEGATIVE_X: number; + TEXTURE_CUBE_MAP_NEGATIVE_Y: number; + TEXTURE_CUBE_MAP_NEGATIVE_Z: number; + TEXTURE_CUBE_MAP_POSITIVE_X: number; + TEXTURE_CUBE_MAP_POSITIVE_Y: number; + TEXTURE_CUBE_MAP_POSITIVE_Z: number; + TEXTURE_MAG_FILTER: number; + TEXTURE_MIN_FILTER: number; + TEXTURE_WRAP_S: number; + TEXTURE_WRAP_T: number; + TRIANGLES: number; + TRIANGLE_FAN: number; + TRIANGLE_STRIP: number; + UNPACK_ALIGNMENT: number; + UNPACK_COLORSPACE_CONVERSION_WEBGL: number; + UNPACK_FLIP_Y_WEBGL: number; + UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; + UNSIGNED_BYTE: number; + UNSIGNED_INT: number; + UNSIGNED_SHORT: number; + UNSIGNED_SHORT_4_4_4_4: number; + UNSIGNED_SHORT_5_5_5_1: number; + UNSIGNED_SHORT_5_6_5: number; + VALIDATE_STATUS: number; + VENDOR: number; + VERSION: number; + VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; + VERTEX_ATTRIB_ARRAY_ENABLED: number; + VERTEX_ATTRIB_ARRAY_NORMALIZED: number; + VERTEX_ATTRIB_ARRAY_POINTER: number; + VERTEX_ATTRIB_ARRAY_SIZE: number; + VERTEX_ATTRIB_ARRAY_STRIDE: number; + VERTEX_ATTRIB_ARRAY_TYPE: number; + VERTEX_SHADER: number; + VIEWPORT: number; + ZERO: number; +} + +interface WebGLShader extends WebGLObject { +} + +declare var WebGLShader: { + prototype: WebGLShader; + new(): WebGLShader; +} + +interface WebGLShaderPrecisionFormat { + precision: number; + rangeMax: number; + rangeMin: number; +} + +declare var WebGLShaderPrecisionFormat: { + prototype: WebGLShaderPrecisionFormat; + new(): WebGLShaderPrecisionFormat; +} + +interface WebGLTexture extends WebGLObject { +} + +declare var WebGLTexture: { + prototype: WebGLTexture; + new(): WebGLTexture; +} + +interface WebGLUniformLocation { +} + +declare var WebGLUniformLocation: { + prototype: WebGLUniformLocation; + new(): WebGLUniformLocation; +} + +interface WebKitCSSMatrix { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + inverse(): WebKitCSSMatrix; + multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix; + rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix; + rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix; + scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix; + setMatrixValue(value: string): void; + skewX(angle: number): WebKitCSSMatrix; + skewY(angle: number): WebKitCSSMatrix; + toString(): string; + translate(x: number, y: number, z?: number): WebKitCSSMatrix; +} + +declare var WebKitCSSMatrix: { + prototype: WebKitCSSMatrix; + new(text?: string): WebKitCSSMatrix; +} + +interface WebKitPoint { + x: number; + y: number; +} + +declare var WebKitPoint: { + prototype: WebKitPoint; + new(x?: number, y?: number): WebKitPoint; +} + +interface WebSocket extends EventTarget { + binaryType: string; + bufferedAmount: number; + extensions: string; + onclose: (ev: CloseEvent) => any; + onerror: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onopen: (ev: Event) => any; + protocol: string; + readyState: number; + url: string; + close(code?: number, reason?: string): void; + send(data: any): void; + CLOSED: number; + CLOSING: number; + CONNECTING: number; + OPEN: number; + addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var WebSocket: { + prototype: WebSocket; + new(url: string, protocols?: string): WebSocket; + new(url: string, protocols?: any): WebSocket; + CLOSED: number; + CLOSING: number; + CONNECTING: number; + OPEN: number; +} + +interface WheelEvent extends MouseEvent { + deltaMode: number; + deltaX: number; + deltaY: number; + deltaZ: number; + getCurrentPoint(element: Element): void; + initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; + DOM_DELTA_PIXEL: number; +} + +declare var WheelEvent: { + prototype: WheelEvent; + new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent; + DOM_DELTA_LINE: number; + DOM_DELTA_PAGE: number; + DOM_DELTA_PIXEL: number; +} + +interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64 { + animationStartTime: number; + applicationCache: ApplicationCache; + clientInformation: Navigator; + closed: boolean; + crypto: Crypto; + defaultStatus: string; + devicePixelRatio: number; + doNotTrack: string; + document: Document; + event: Event; + external: External; + frameElement: Element; + frames: Window; + history: History; + innerHeight: number; + innerWidth: number; + length: number; + location: Location; + locationbar: BarProp; + menubar: BarProp; + msAnimationStartTime: number; + msTemplatePrinter: MSTemplatePrinter; + name: string; + navigator: Navigator; + offscreenBuffering: string | boolean; + onabort: (ev: Event) => any; + onafterprint: (ev: Event) => any; + onbeforeprint: (ev: Event) => any; + onbeforeunload: (ev: BeforeUnloadEvent) => any; + onblur: (ev: FocusEvent) => any; + oncanplay: (ev: Event) => any; + oncanplaythrough: (ev: Event) => any; + onchange: (ev: Event) => any; + onclick: (ev: MouseEvent) => any; + oncompassneedscalibration: (ev: Event) => any; + oncontextmenu: (ev: PointerEvent) => any; + ondblclick: (ev: MouseEvent) => any; + ondevicemotion: (ev: DeviceMotionEvent) => any; + ondeviceorientation: (ev: DeviceOrientationEvent) => any; + ondrag: (ev: DragEvent) => any; + ondragend: (ev: DragEvent) => any; + ondragenter: (ev: DragEvent) => any; + ondragleave: (ev: DragEvent) => any; + ondragover: (ev: DragEvent) => any; + ondragstart: (ev: DragEvent) => any; + ondrop: (ev: DragEvent) => any; + ondurationchange: (ev: Event) => any; + onemptied: (ev: Event) => any; + onended: (ev: Event) => any; + onerror: ErrorEventHandler; + onfocus: (ev: FocusEvent) => any; + onhashchange: (ev: HashChangeEvent) => any; + oninput: (ev: Event) => any; + onkeydown: (ev: KeyboardEvent) => any; + onkeypress: (ev: KeyboardEvent) => any; + onkeyup: (ev: KeyboardEvent) => any; + onload: (ev: Event) => any; + onloadeddata: (ev: Event) => any; + onloadedmetadata: (ev: Event) => any; + onloadstart: (ev: Event) => any; + onmessage: (ev: MessageEvent) => any; + onmousedown: (ev: MouseEvent) => any; + onmouseenter: (ev: MouseEvent) => any; + onmouseleave: (ev: MouseEvent) => any; + onmousemove: (ev: MouseEvent) => any; + onmouseout: (ev: MouseEvent) => any; + onmouseover: (ev: MouseEvent) => any; + onmouseup: (ev: MouseEvent) => any; + onmousewheel: (ev: MouseWheelEvent) => any; + onmsgesturechange: (ev: MSGestureEvent) => any; + onmsgesturedoubletap: (ev: MSGestureEvent) => any; + onmsgestureend: (ev: MSGestureEvent) => any; + onmsgesturehold: (ev: MSGestureEvent) => any; + onmsgesturestart: (ev: MSGestureEvent) => any; + onmsgesturetap: (ev: MSGestureEvent) => any; + onmsinertiastart: (ev: MSGestureEvent) => any; + onmspointercancel: (ev: MSPointerEvent) => any; + onmspointerdown: (ev: MSPointerEvent) => any; + onmspointerenter: (ev: MSPointerEvent) => any; + onmspointerleave: (ev: MSPointerEvent) => any; + onmspointermove: (ev: MSPointerEvent) => any; + onmspointerout: (ev: MSPointerEvent) => any; + onmspointerover: (ev: MSPointerEvent) => any; + onmspointerup: (ev: MSPointerEvent) => any; + onoffline: (ev: Event) => any; + ononline: (ev: Event) => any; + onorientationchange: (ev: Event) => any; + onpagehide: (ev: PageTransitionEvent) => any; + onpageshow: (ev: PageTransitionEvent) => any; + onpause: (ev: Event) => any; + onplay: (ev: Event) => any; + onplaying: (ev: Event) => any; + onpopstate: (ev: PopStateEvent) => any; + onprogress: (ev: ProgressEvent) => any; + onratechange: (ev: Event) => any; + onreadystatechange: (ev: ProgressEvent) => any; + onreset: (ev: Event) => any; + onresize: (ev: UIEvent) => any; + onscroll: (ev: UIEvent) => any; + onseeked: (ev: Event) => any; + onseeking: (ev: Event) => any; + onselect: (ev: UIEvent) => any; + onstalled: (ev: Event) => any; + onstorage: (ev: StorageEvent) => any; + onsubmit: (ev: Event) => any; + onsuspend: (ev: Event) => any; + ontimeupdate: (ev: Event) => any; + ontouchcancel: any; + ontouchend: any; + ontouchmove: any; + ontouchstart: any; + onunload: (ev: Event) => any; + onvolumechange: (ev: Event) => any; + onwaiting: (ev: Event) => any; + opener: Window; + orientation: string; + outerHeight: number; + outerWidth: number; + pageXOffset: number; + pageYOffset: number; + parent: Window; + performance: Performance; + personalbar: BarProp; + screen: Screen; + screenLeft: number; + screenTop: number; + screenX: number; + screenY: number; + scrollX: number; + scrollY: number; + scrollbars: BarProp; + self: Window; + status: string; + statusbar: BarProp; + styleMedia: StyleMedia; + toolbar: BarProp; + top: Window; + window: Window; + alert(message?: any): void; + blur(): void; + cancelAnimationFrame(handle: number): void; + captureEvents(): void; + close(): void; + confirm(message?: string): boolean; + focus(): void; + getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; + getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; + getSelection(): Selection; + matchMedia(mediaQuery: string): MediaQueryList; + moveBy(x?: number, y?: number): void; + moveTo(x?: number, y?: number): void; + msCancelRequestAnimationFrame(handle: number): void; + msMatchMedia(mediaQuery: string): MediaQueryList; + msRequestAnimationFrame(callback: FrameRequestCallback): number; + msWriteProfilerMark(profilerMarkName: string): void; + open(url?: string, target?: string, features?: string, replace?: boolean): any; + postMessage(message: any, targetOrigin: string, ports?: any): void; + print(): void; + prompt(message?: string, _default?: string): string; + releaseEvents(): void; + requestAnimationFrame(callback: FrameRequestCallback): number; + resizeBy(x?: number, y?: number): void; + resizeTo(x?: number, y?: number): void; + scroll(x?: number, y?: number): void; + scrollBy(x?: number, y?: number): void; + scrollTo(x?: number, y?: number): void; + webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; + webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; + addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; + addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; + addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; + addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; + addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; + addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; + addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; + [index: number]: Window; +} + +declare var Window: { + prototype: Window; + new(): Window; +} + +interface Worker extends EventTarget, AbstractWorker { + onmessage: (ev: MessageEvent) => any; + postMessage(message: any, ports?: any): void; + terminate(): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var Worker: { + prototype: Worker; + new(stringUrl: string): Worker; +} + +interface XMLDocument extends Document { +} + +declare var XMLDocument: { + prototype: XMLDocument; + new(): XMLDocument; +} + +interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget { + msCaching: string; + onreadystatechange: (ev: ProgressEvent) => any; + readyState: number; + response: any; + responseBody: any; + responseText: string; + responseType: string; + responseXML: any; + status: number; + statusText: string; + timeout: number; + upload: XMLHttpRequestUpload; + withCredentials: boolean; + abort(): void; + getAllResponseHeaders(): string; + getResponseHeader(header: string): string; + msCachingEnabled(): boolean; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + overrideMimeType(mime: string): void; + send(data?: Document): void; + send(data?: string): void; + setRequestHeader(header: string, value: string): void; + DONE: number; + HEADERS_RECEIVED: number; + LOADING: number; + OPENED: number; + UNSENT: number; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequest: { + prototype: XMLHttpRequest; + new(): XMLHttpRequest; + DONE: number; + HEADERS_RECEIVED: number; + LOADING: number; + OPENED: number; + UNSENT: number; + create(): XMLHttpRequest; +} + +interface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget { + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +declare var XMLHttpRequestUpload: { + prototype: XMLHttpRequestUpload; + new(): XMLHttpRequestUpload; +} + +interface XMLSerializer { + serializeToString(target: Node): string; +} + +declare var XMLSerializer: { + prototype: XMLSerializer; + new(): XMLSerializer; +} + +interface XPathEvaluator { + createExpression(expression: string, resolver: XPathNSResolver): XPathExpression; + createNSResolver(nodeResolver?: Node): XPathNSResolver; + evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver, type: number, result: XPathResult): XPathResult; +} + +declare var XPathEvaluator: { + prototype: XPathEvaluator; + new(): XPathEvaluator; +} + +interface XPathExpression { + evaluate(contextNode: Node, type: number, result: XPathResult): XPathExpression; +} + +declare var XPathExpression: { + prototype: XPathExpression; + new(): XPathExpression; +} + +interface XPathNSResolver { + lookupNamespaceURI(prefix: string): string; +} + +declare var XPathNSResolver: { + prototype: XPathNSResolver; + new(): XPathNSResolver; +} + +interface XPathResult { + booleanValue: boolean; + invalidIteratorState: boolean; + numberValue: number; + resultType: number; + singleNodeValue: Node; + snapshotLength: number; + stringValue: string; + iterateNext(): Node; + snapshotItem(index: number): Node; + ANY_TYPE: number; + ANY_UNORDERED_NODE_TYPE: number; + BOOLEAN_TYPE: number; + FIRST_ORDERED_NODE_TYPE: number; + NUMBER_TYPE: number; + ORDERED_NODE_ITERATOR_TYPE: number; + ORDERED_NODE_SNAPSHOT_TYPE: number; + STRING_TYPE: number; + UNORDERED_NODE_ITERATOR_TYPE: number; + UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +declare var XPathResult: { + prototype: XPathResult; + new(): XPathResult; + ANY_TYPE: number; + ANY_UNORDERED_NODE_TYPE: number; + BOOLEAN_TYPE: number; + FIRST_ORDERED_NODE_TYPE: number; + NUMBER_TYPE: number; + ORDERED_NODE_ITERATOR_TYPE: number; + ORDERED_NODE_SNAPSHOT_TYPE: number; + STRING_TYPE: number; + UNORDERED_NODE_ITERATOR_TYPE: number; + UNORDERED_NODE_SNAPSHOT_TYPE: number; +} + +interface XSLTProcessor { + clearParameters(): void; + getParameter(namespaceURI: string, localName: string): any; + importStylesheet(style: Node): void; + removeParameter(namespaceURI: string, localName: string): void; + reset(): void; + setParameter(namespaceURI: string, localName: string, value: any): void; + transformToDocument(source: Node): Document; + transformToFragment(source: Node, document: Document): DocumentFragment; +} + +declare var XSLTProcessor: { + prototype: XSLTProcessor; + new(): XSLTProcessor; +} + +interface AbstractWorker { + onerror: (ev: Event) => any; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface ChildNode { + remove(): void; +} + +interface DOML2DeprecatedColorProperty { + color: string; +} + +interface DOML2DeprecatedSizeProperty { + size: number; +} + +interface DocumentEvent { + createEvent(eventInterface:"AnimationEvent"): AnimationEvent; + createEvent(eventInterface:"AriaRequestEvent"): AriaRequestEvent; + createEvent(eventInterface:"AudioProcessingEvent"): AudioProcessingEvent; + createEvent(eventInterface:"BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface:"CloseEvent"): CloseEvent; + createEvent(eventInterface:"CommandEvent"): CommandEvent; + createEvent(eventInterface:"CompositionEvent"): CompositionEvent; + createEvent(eventInterface: "CustomEvent"): CustomEvent; + createEvent(eventInterface:"DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface:"DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface:"DragEvent"): DragEvent; + createEvent(eventInterface:"ErrorEvent"): ErrorEvent; + createEvent(eventInterface:"Event"): Event; + createEvent(eventInterface:"Events"): Event; + createEvent(eventInterface:"FocusEvent"): FocusEvent; + createEvent(eventInterface:"GamepadEvent"): GamepadEvent; + createEvent(eventInterface:"HashChangeEvent"): HashChangeEvent; + createEvent(eventInterface:"IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface:"KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface:"LongRunningScriptDetectedEvent"): LongRunningScriptDetectedEvent; + createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface:"MSManipulationEvent"): MSManipulationEvent; + createEvent(eventInterface:"MSMediaKeyMessageEvent"): MSMediaKeyMessageEvent; + createEvent(eventInterface:"MSMediaKeyNeededEvent"): MSMediaKeyNeededEvent; + createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; + createEvent(eventInterface:"MSSiteModeEvent"): MSSiteModeEvent; + createEvent(eventInterface:"MessageEvent"): MessageEvent; + createEvent(eventInterface:"MouseEvent"): MouseEvent; + createEvent(eventInterface:"MouseEvents"): MouseEvent; + createEvent(eventInterface:"MouseWheelEvent"): MouseWheelEvent; + createEvent(eventInterface:"MSGestureEvent"): MSGestureEvent; + createEvent(eventInterface:"MSPointerEvent"): MSPointerEvent; + createEvent(eventInterface:"MutationEvent"): MutationEvent; + createEvent(eventInterface:"MutationEvents"): MutationEvent; + createEvent(eventInterface:"NavigationCompletedEvent"): NavigationCompletedEvent; + createEvent(eventInterface:"NavigationEvent"): NavigationEvent; + createEvent(eventInterface:"NavigationEventWithReferrer"): NavigationEventWithReferrer; + createEvent(eventInterface:"OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; + createEvent(eventInterface:"PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface:"PermissionRequestedEvent"): PermissionRequestedEvent; + createEvent(eventInterface:"PointerEvent"): PointerEvent; + createEvent(eventInterface:"PopStateEvent"): PopStateEvent; + createEvent(eventInterface:"ProgressEvent"): ProgressEvent; + createEvent(eventInterface:"SVGZoomEvent"): SVGZoomEvent; + createEvent(eventInterface:"SVGZoomEvents"): SVGZoomEvent; + createEvent(eventInterface:"ScriptNotifyEvent"): ScriptNotifyEvent; + createEvent(eventInterface:"StorageEvent"): StorageEvent; + createEvent(eventInterface:"TextEvent"): TextEvent; + createEvent(eventInterface:"TouchEvent"): TouchEvent; + createEvent(eventInterface:"TrackEvent"): TrackEvent; + createEvent(eventInterface:"TransitionEvent"): TransitionEvent; + createEvent(eventInterface:"UIEvent"): UIEvent; + createEvent(eventInterface:"UIEvents"): UIEvent; + createEvent(eventInterface:"UnviewableContentIdentifiedEvent"): UnviewableContentIdentifiedEvent; + createEvent(eventInterface:"WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface:"WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; +} + +interface ElementTraversal { + childElementCount: number; + firstElementChild: Element; + lastElementChild: Element; + nextElementSibling: Element; + previousElementSibling: Element; +} + +interface GetSVGDocument { + getSVGDocument(): Document; +} + +interface GlobalEventHandlers { + onpointercancel: (ev: PointerEvent) => any; + onpointerdown: (ev: PointerEvent) => any; + onpointerenter: (ev: PointerEvent) => any; + onpointerleave: (ev: PointerEvent) => any; + onpointermove: (ev: PointerEvent) => any; + onpointerout: (ev: PointerEvent) => any; + onpointerover: (ev: PointerEvent) => any; + onpointerup: (ev: PointerEvent) => any; + onwheel: (ev: WheelEvent) => any; + addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; + addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface HTMLTableAlignment { + /** + * Sets or retrieves a value that you can use to implement your own ch functionality for the object. + */ + ch: string; + /** + * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. + */ + chOff: string; + /** + * Sets or retrieves how text and other content are vertically aligned within the object that contains them. + */ + vAlign: string; +} + +interface IDBEnvironment { + indexedDB: IDBFactory; + msIndexedDB: IDBFactory; +} + +interface LinkStyle { + sheet: StyleSheet; +} + +interface MSBaseReader { + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + onloadstart: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + readyState: number; + result: any; + abort(): void; + DONE: number; + EMPTY: number; + LOADING: number; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + +interface MSFileSaver { + msSaveBlob(blob: any, defaultName?: string): boolean; + msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; +} + +interface MSNavigatorDoNotTrack { + confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; + confirmWebWideTrackingException(args: ExceptionInformation): boolean; + removeSiteSpecificTrackingException(args: ExceptionInformation): void; + removeWebWideTrackingException(args: ExceptionInformation): void; + storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; + storeWebWideTrackingException(args: StoreExceptionsInformation): void; +} + +interface NavigatorContentUtils { +} + +interface NavigatorGeolocation { + geolocation: Geolocation; +} + +interface NavigatorID { + appName: string; + appVersion: string; + platform: string; + product: string; + productSub: string; + userAgent: string; + vendor: string; + vendorSub: string; +} + +interface NavigatorOnLine { + onLine: boolean; +} + +interface NavigatorStorageUtils { +} + +interface NodeSelector { + querySelector(selectors: string): Element; + querySelectorAll(selectors: string): NodeList; +} + +interface RandomSource { + getRandomValues(array: ArrayBufferView): ArrayBufferView; +} + +interface SVGAnimatedPathData { + pathSegList: SVGPathSegList; +} + +interface SVGAnimatedPoints { + animatedPoints: SVGPointList; + points: SVGPointList; +} + +interface SVGExternalResourcesRequired { + externalResourcesRequired: SVGAnimatedBoolean; +} + +interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { + height: SVGAnimatedLength; + result: SVGAnimatedString; + width: SVGAnimatedLength; + x: SVGAnimatedLength; + y: SVGAnimatedLength; +} + +interface SVGFitToViewBox { + preserveAspectRatio: SVGAnimatedPreserveAspectRatio; + viewBox: SVGAnimatedRect; +} + +interface SVGLangSpace { + xmllang: string; + xmlspace: string; +} + +interface SVGLocatable { + farthestViewportElement: SVGElement; + nearestViewportElement: SVGElement; + getBBox(): SVGRect; + getCTM(): SVGMatrix; + getScreenCTM(): SVGMatrix; + getTransformToElement(element: SVGElement): SVGMatrix; +} + +interface SVGStylable { + className: SVGAnimatedString; + style: CSSStyleDeclaration; +} + +interface SVGTests { + requiredExtensions: SVGStringList; + requiredFeatures: SVGStringList; + systemLanguage: SVGStringList; + hasExtension(extension: string): boolean; +} + +interface SVGTransformable extends SVGLocatable { + transform: SVGAnimatedTransformList; +} + +interface SVGURIReference { + href: SVGAnimatedString; +} + +interface WindowBase64 { + atob(encodedString: string): string; + btoa(rawString: string): string; +} + +interface WindowConsole { + console: Console; +} + +interface WindowLocalStorage { + localStorage: Storage; +} + +interface WindowSessionStorage { + sessionStorage: Storage; +} + +interface WindowTimers extends Object, WindowTimersExtension { + clearInterval(handle: number): void; + clearTimeout(handle: number): void; + setInterval(handler: any, timeout?: any, ...args: any[]): number; + setTimeout(handler: any, timeout?: any, ...args: any[]): number; +} + +interface WindowTimersExtension { + clearImmediate(handle: number): void; + msClearImmediate(handle: number): void; + msSetImmediate(expression: any, ...args: any[]): number; + setImmediate(expression: any, ...args: any[]): number; +} + +interface XMLHttpRequestEventTarget { + onabort: (ev: Event) => any; + onerror: (ev: Event) => any; + onload: (ev: Event) => any; + onloadend: (ev: ProgressEvent) => any; + onloadstart: (ev: Event) => any; + onprogress: (ev: ProgressEvent) => any; + ontimeout: (ev: ProgressEvent) => any; + addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; + addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; + addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; + addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: "timeout", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +} + + +interface NodeListOf extends NodeList { + length: number; + item(index: number): TNode; + [index: number]: TNode; +} + +interface BlobPropertyBag { + type?: string; + endings?: string; +} + +interface EventListenerObject { + handleEvent(evt: Event): void; +} + +declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject; + +interface ErrorEventHandler { + (event: Event, source?: string, fileno?: number, columnNumber?: number): void; + (event: string, source?: string, fileno?: number, columnNumber?: number): void; +} +interface PositionCallback { + (position: Position): void; +} +interface PositionErrorCallback { + (error: PositionError): void; +} +interface MediaQueryListListener { + (mql: MediaQueryList): void; +} +interface MSLaunchUriCallback { + (): void; +} +interface FrameRequestCallback { + (time: number): void; +} +interface MSUnsafeFunctionCallback { + (): any; +} +interface MSExecAtPriorityFunctionCallback { + (...args: any[]): any; +} +interface MutationCallback { + (mutations: MutationRecord[], observer: MutationObserver): void; +} +interface DecodeSuccessCallback { + (decodedData: AudioBuffer): void; +} +interface DecodeErrorCallback { + (): void; +} +interface FunctionStringCallback { + (data: string): void; +} +declare var Audio: {new(src?: string): HTMLAudioElement; }; +declare var Image: {new(width?: number, height?: number): HTMLImageElement; }; +declare var Option: {new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; +declare var animationStartTime: number; +declare var applicationCache: ApplicationCache; +declare var clientInformation: Navigator; +declare var closed: boolean; +declare var crypto: Crypto; +declare var defaultStatus: string; +declare var devicePixelRatio: number; +declare var doNotTrack: string; +declare var document: Document; +declare var event: Event; +declare var external: External; +declare var frameElement: Element; +declare var frames: Window; +declare var history: History; +declare var innerHeight: number; +declare var innerWidth: number; +declare var length: number; +declare var location: Location; +declare var locationbar: BarProp; +declare var menubar: BarProp; +declare var msAnimationStartTime: number; +declare var msTemplatePrinter: MSTemplatePrinter; +declare var name: string; +declare var navigator: Navigator; +declare var offscreenBuffering: string | boolean; +declare var onabort: (ev: Event) => any; +declare var onafterprint: (ev: Event) => any; +declare var onbeforeprint: (ev: Event) => any; +declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; +declare var onblur: (ev: FocusEvent) => any; +declare var oncanplay: (ev: Event) => any; +declare var oncanplaythrough: (ev: Event) => any; +declare var onchange: (ev: Event) => any; +declare var onclick: (ev: MouseEvent) => any; +declare var oncompassneedscalibration: (ev: Event) => any; +declare var oncontextmenu: (ev: PointerEvent) => any; +declare var ondblclick: (ev: MouseEvent) => any; +declare var ondevicemotion: (ev: DeviceMotionEvent) => any; +declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; +declare var ondrag: (ev: DragEvent) => any; +declare var ondragend: (ev: DragEvent) => any; +declare var ondragenter: (ev: DragEvent) => any; +declare var ondragleave: (ev: DragEvent) => any; +declare var ondragover: (ev: DragEvent) => any; +declare var ondragstart: (ev: DragEvent) => any; +declare var ondrop: (ev: DragEvent) => any; +declare var ondurationchange: (ev: Event) => any; +declare var onemptied: (ev: Event) => any; +declare var onended: (ev: Event) => any; +declare var onerror: ErrorEventHandler; +declare var onfocus: (ev: FocusEvent) => any; +declare var onhashchange: (ev: HashChangeEvent) => any; +declare var oninput: (ev: Event) => any; +declare var onkeydown: (ev: KeyboardEvent) => any; +declare var onkeypress: (ev: KeyboardEvent) => any; +declare var onkeyup: (ev: KeyboardEvent) => any; +declare var onload: (ev: Event) => any; +declare var onloadeddata: (ev: Event) => any; +declare var onloadedmetadata: (ev: Event) => any; +declare var onloadstart: (ev: Event) => any; +declare var onmessage: (ev: MessageEvent) => any; +declare var onmousedown: (ev: MouseEvent) => any; +declare var onmouseenter: (ev: MouseEvent) => any; +declare var onmouseleave: (ev: MouseEvent) => any; +declare var onmousemove: (ev: MouseEvent) => any; +declare var onmouseout: (ev: MouseEvent) => any; +declare var onmouseover: (ev: MouseEvent) => any; +declare var onmouseup: (ev: MouseEvent) => any; +declare var onmousewheel: (ev: MouseWheelEvent) => any; +declare var onmsgesturechange: (ev: MSGestureEvent) => any; +declare var onmsgesturedoubletap: (ev: MSGestureEvent) => any; +declare var onmsgestureend: (ev: MSGestureEvent) => any; +declare var onmsgesturehold: (ev: MSGestureEvent) => any; +declare var onmsgesturestart: (ev: MSGestureEvent) => any; +declare var onmsgesturetap: (ev: MSGestureEvent) => any; +declare var onmsinertiastart: (ev: MSGestureEvent) => any; +declare var onmspointercancel: (ev: MSPointerEvent) => any; +declare var onmspointerdown: (ev: MSPointerEvent) => any; +declare var onmspointerenter: (ev: MSPointerEvent) => any; +declare var onmspointerleave: (ev: MSPointerEvent) => any; +declare var onmspointermove: (ev: MSPointerEvent) => any; +declare var onmspointerout: (ev: MSPointerEvent) => any; +declare var onmspointerover: (ev: MSPointerEvent) => any; +declare var onmspointerup: (ev: MSPointerEvent) => any; +declare var onoffline: (ev: Event) => any; +declare var ononline: (ev: Event) => any; +declare var onorientationchange: (ev: Event) => any; +declare var onpagehide: (ev: PageTransitionEvent) => any; +declare var onpageshow: (ev: PageTransitionEvent) => any; +declare var onpause: (ev: Event) => any; +declare var onplay: (ev: Event) => any; +declare var onplaying: (ev: Event) => any; +declare var onpopstate: (ev: PopStateEvent) => any; +declare var onprogress: (ev: ProgressEvent) => any; +declare var onratechange: (ev: Event) => any; +declare var onreadystatechange: (ev: ProgressEvent) => any; +declare var onreset: (ev: Event) => any; +declare var onresize: (ev: UIEvent) => any; +declare var onscroll: (ev: UIEvent) => any; +declare var onseeked: (ev: Event) => any; +declare var onseeking: (ev: Event) => any; +declare var onselect: (ev: UIEvent) => any; +declare var onstalled: (ev: Event) => any; +declare var onstorage: (ev: StorageEvent) => any; +declare var onsubmit: (ev: Event) => any; +declare var onsuspend: (ev: Event) => any; +declare var ontimeupdate: (ev: Event) => any; +declare var ontouchcancel: any; +declare var ontouchend: any; +declare var ontouchmove: any; +declare var ontouchstart: any; +declare var onunload: (ev: Event) => any; +declare var onvolumechange: (ev: Event) => any; +declare var onwaiting: (ev: Event) => any; +declare var opener: Window; +declare var orientation: string; +declare var outerHeight: number; +declare var outerWidth: number; +declare var pageXOffset: number; +declare var pageYOffset: number; +declare var parent: Window; +declare var performance: Performance; +declare var personalbar: BarProp; +declare var screen: Screen; +declare var screenLeft: number; +declare var screenTop: number; +declare var screenX: number; +declare var screenY: number; +declare var scrollX: number; +declare var scrollY: number; +declare var scrollbars: BarProp; +declare var self: Window; +declare var status: string; +declare var statusbar: BarProp; +declare var styleMedia: StyleMedia; +declare var toolbar: BarProp; +declare var top: Window; +declare var window: Window; +declare function alert(message?: any): void; +declare function blur(): void; +declare function cancelAnimationFrame(handle: number): void; +declare function captureEvents(): void; +declare function close(): void; +declare function confirm(message?: string): boolean; +declare function focus(): void; +declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; +declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList; +declare function getSelection(): Selection; +declare function matchMedia(mediaQuery: string): MediaQueryList; +declare function moveBy(x?: number, y?: number): void; +declare function moveTo(x?: number, y?: number): void; +declare function msCancelRequestAnimationFrame(handle: number): void; +declare function msMatchMedia(mediaQuery: string): MediaQueryList; +declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; +declare function msWriteProfilerMark(profilerMarkName: string): void; +declare function open(url?: string, target?: string, features?: string, replace?: boolean): any; +declare function postMessage(message: any, targetOrigin: string, ports?: any): void; +declare function print(): void; +declare function prompt(message?: string, _default?: string): string; +declare function releaseEvents(): void; +declare function requestAnimationFrame(callback: FrameRequestCallback): number; +declare function resizeBy(x?: number, y?: number): void; +declare function resizeTo(x?: number, y?: number): void; +declare function scroll(x?: number, y?: number): void; +declare function scrollBy(x?: number, y?: number): void; +declare function scrollTo(x?: number, y?: number): void; +declare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint; +declare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint; +declare function toString(): string; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +declare function dispatchEvent(evt: Event): boolean; +declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +declare function clearInterval(handle: number): void; +declare function clearTimeout(handle: number): void; +declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; +declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; +declare function clearImmediate(handle: number): void; +declare function msClearImmediate(handle: number): void; +declare function msSetImmediate(expression: any, ...args: any[]): number; +declare function setImmediate(expression: any, ...args: any[]): number; +declare var sessionStorage: Storage; +declare var localStorage: Storage; +declare var console: Console; +declare var onpointercancel: (ev: PointerEvent) => any; +declare var onpointerdown: (ev: PointerEvent) => any; +declare var onpointerenter: (ev: PointerEvent) => any; +declare var onpointerleave: (ev: PointerEvent) => any; +declare var onpointermove: (ev: PointerEvent) => any; +declare var onpointerout: (ev: PointerEvent) => any; +declare var onpointerover: (ev: PointerEvent) => any; +declare var onpointerup: (ev: PointerEvent) => any; +declare var onwheel: (ev: WheelEvent) => any; +declare var indexedDB: IDBFactory; +declare var msIndexedDB: IDBFactory; +declare function atob(encodedString: string): string; +declare function btoa(rawString: string): string; +declare function addEventListener(type: "MSGestureChange", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureDoubleTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureEnd", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureHold", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSGestureTap", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerLeave", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerMove", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerOut", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerOver", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "MSPointerUp", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "compassneedscalibration", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "contextmenu", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "hashchange", listener: (ev: HashChangeEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "orientationchange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "readystatechange", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; +declare function addEventListener(type: "wheel", listener: (ev: WheelEvent) => any, useCapture?: boolean): void; +declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void; +///////////////////////////// +/// WorkerGlobalScope APIs +///////////////////////////// +// These are only available in a Web Worker +declare function importScripts(...urls: string[]): void; + + +///////////////////////////// +/// Windows Script Host APIS +///////////////////////////// + + +interface ActiveXObject { + new (s: string): any; +} +declare var ActiveXObject: ActiveXObject; + +interface ITextWriter { + Write(s: string): void; + WriteLine(s: string): void; + Close(): void; +} + +interface TextStreamBase { + /** + * The column number of the current character position in an input stream. + */ + Column: number; + + /** + * The current line number in an input stream. + */ + Line: number; + + /** + * Closes a text stream. + * It is not necessary to close standard streams; they close automatically when the process ends. If + * you close a standard stream, be aware that any other pointers to that standard stream become invalid. + */ + Close(): void; +} + +interface TextStreamWriter extends TextStreamBase { + /** + * Sends a string to an output stream. + */ + Write(s: string): void; + + /** + * Sends a specified number of blank lines (newline characters) to an output stream. + */ + WriteBlankLines(intLines: number): void; + + /** + * Sends a string followed by a newline character to an output stream. + */ + WriteLine(s: string): void; +} + +interface TextStreamReader extends TextStreamBase { + /** + * Returns a specified number of characters from an input stream, starting at the current pointer position. + * Does not return until the ENTER key is pressed. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + Read(characters: number): string; + + /** + * Returns all characters from an input stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadAll(): string; + + /** + * Returns an entire line from an input stream. + * Although this method extracts the newline character, it does not add it to the returned string. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + */ + ReadLine(): string; + + /** + * Skips a specified number of characters when reading from an input text stream. + * Can only be used on a stream in reading mode; causes an error in writing or appending mode. + * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.) + */ + Skip(characters: number): void; + + /** + * Skips the next line when reading from an input text stream. + * Can only be used on a stream in reading mode, not writing or appending mode. + */ + SkipLine(): void; + + /** + * Indicates whether the stream pointer position is at the end of a line. + */ + AtEndOfLine: boolean; + + /** + * Indicates whether the stream pointer position is at the end of a stream. + */ + AtEndOfStream: boolean; +} + +declare var WScript: { + /** + * Outputs text to either a message box (under WScript.exe) or the command console window followed by + * a newline (under CScript.exe). + */ + Echo(s: any): void; + + /** + * Exposes the write-only error output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdErr: TextStreamWriter; + + /** + * Exposes the write-only output stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdOut: TextStreamWriter; + Arguments: { length: number; Item(n: number): string; }; + + /** + * The full path of the currently running script. + */ + ScriptFullName: string; + + /** + * Forces the script to stop immediately, with an optional exit code. + */ + Quit(exitCode?: number): number; + + /** + * The Windows Script Host build version number. + */ + BuildVersion: number; + + /** + * Fully qualified path of the host executable. + */ + FullName: string; + + /** + * Gets/sets the script mode - interactive(true) or batch(false). + */ + Interactive: boolean; + + /** + * The name of the host executable (WScript.exe or CScript.exe). + */ + Name: string; + + /** + * Path of the directory containing the host executable. + */ + Path: string; + + /** + * The filename of the currently running script. + */ + ScriptName: string; + + /** + * Exposes the read-only input stream for the current script. + * Can be accessed only while using CScript.exe. + */ + StdIn: TextStreamReader; + + /** + * Windows Script Host version + */ + Version: string; + + /** + * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event. + */ + ConnectObject(objEventSource: any, strPrefix: string): void; + + /** + * Creates a COM object. + * @param strProgiID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + CreateObject(strProgID: string, strPrefix?: string): any; + + /** + * Disconnects a COM object from its event sources. + */ + DisconnectObject(obj: any): void; + + /** + * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file. + * @param strPathname Fully qualified path to the file containing the object persisted to disk. + * For objects in memory, pass a zero-length string. + * @param strProgID + * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. + */ + GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; + + /** + * Suspends script execution for a specified length of time, then continues execution. + * @param intTime Interval (in milliseconds) to suspend script execution. + */ + Sleep(intTime: number): void; +}; + +/** + * Allows enumerating over a COM collection, which may not have indexed item access. + */ +interface Enumerator { + /** + * Returns true if the current item is the last one in the collection, or the collection is empty, + * or the current item is undefined. + */ + atEnd(): boolean; + + /** + * Returns the current item in the collection + */ + item(): T; + + /** + * Resets the current item in the collection to the first item. If there are no items in the collection, + * the current item is set to undefined. + */ + moveFirst(): void; + + /** + * Moves the current item to the next item in the collection. If the enumerator is at the end of + * the collection or the collection is empty, the current item is set to undefined. + */ + moveNext(): void; +} + +interface EnumeratorConstructor { + new (collection: any): Enumerator; + new (collection: any): Enumerator; +} + +declare var Enumerator: EnumeratorConstructor; + +/** + * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions. + */ +interface VBArray { + /** + * Returns the number of dimensions (1-based). + */ + dimensions(): number; + + /** + * Takes an index for each dimension in the array, and returns the item at the corresponding location. + */ + getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T; + + /** + * Returns the smallest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + lbound(dimension?: number): number; + + /** + * Returns the largest available index for a given dimension. + * @param dimension 1-based dimension (defaults to 1) + */ + ubound(dimension?: number): number; + + /** + * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, + * each successive dimension is appended to the end of the array. + * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] + */ + toArray(): T[]; +} + +interface VBArrayConstructor { + new (safeArray: any): VBArray; + new (safeArray: any): VBArray; +} + +declare var VBArray: VBArrayConstructor; diff --git a/src/Jackett.Web/typings/nprogress.d.ts b/src/Jackett.Web/typings/nprogress.d.ts new file mode 100644 index 000000000..33c913d1a --- /dev/null +++ b/src/Jackett.Web/typings/nprogress.d.ts @@ -0,0 +1,4 @@ +declare module "nprogress" { + var nprogress:any; + export default nprogress +} diff --git a/src/Jackett.Web/typings/reflect-metadata.d.ts b/src/Jackett.Web/typings/reflect-metadata.d.ts new file mode 100644 index 000000000..30f67e842 --- /dev/null +++ b/src/Jackett.Web/typings/reflect-metadata.d.ts @@ -0,0 +1,485 @@ +/*! ***************************************************************************** +Copyright (C) Microsoft. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and +limitations under the License. +***************************************************************************** */ +declare module "reflect-metadata" { + // The "reflect-metadata" module has no imports or exports, but can be used by modules to load the polyfill. +} + +declare module Reflect { + /** + * Applies a set of decorators to a target object. + * @param decorators An array of decorators. + * @param target The target object. + * @returns The result of applying the provided decorators. + * @remarks Decorators are applied in reverse order of their positions in the array. + * @example + * + * class C { } + * + * // constructor + * C = Reflect.decorate(decoratorsArray, C); + * + */ + function decorate(decorators: ClassDecorator[], target: Function): Function; + /** + * Applies a set of decorators to a property of a target object. + * @param decorators An array of decorators. + * @param target The target object. + * @param targetKey The property key to decorate. + * @param descriptor A property descriptor + * @remarks Decorators are applied in reverse order. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod() { } + * method() { } + * } + * + * // property (on constructor) + * Reflect.decorate(decoratorsArray, C, "staticProperty"); + * + * // property (on prototype) + * Reflect.decorate(decoratorsArray, C.prototype, "property"); + * + * // method (on constructor) + * Object.defineProperty(C, "staticMethod", + * Reflect.decorate(decoratorsArray, C, "staticMethod", + * Object.getOwnPropertyDescriptor(C, "staticMethod"))); + * + * // method (on prototype) + * Object.defineProperty(C.prototype, "method", + * Reflect.decorate(decoratorsArray, C.prototype, "method", + * Object.getOwnPropertyDescriptor(C.prototype, "method"))); + * + */ + function decorate(decorators: (PropertyDecorator | MethodDecorator)[], target: Object, targetKey: string | symbol, descriptor?: PropertyDescriptor): PropertyDescriptor; + /** + * A default metadata decorator factory that can be used on a class, class member, or parameter. + * @param metadataKey The key for the metadata entry. + * @param metadataValue The value for the metadata entry. + * @returns A decorator function. + * @remarks + * If `metadataKey` is already defined for the target and target key, the + * metadataValue for that key will be overwritten. + * @example + * + * // constructor + * @Reflect.metadata(key, value) + * class C { + * } + * + * // property (on constructor, TypeScript only) + * class C { + * @Reflect.metadata(key, value) + * static staticProperty; + * } + * + * // property (on prototype, TypeScript only) + * class C { + * @Reflect.metadata(key, value) + * property; + * } + * + * // method (on constructor) + * class C { + * @Reflect.metadata(key, value) + * static staticMethod() { } + * } + * + * // method (on prototype) + * class C { + * @Reflect.metadata(key, value) + * method() { } + * } + * + */ + function metadata(metadataKey: any, metadataValue: any): ClassDecorator | MethodDecorator | PropertyDecorator; + /** + * Define a unique metadata entry on the target. + * @param metadataKey A key used to store and retrieve metadata. + * @param metadataValue A value that contains attached metadata. + * @param target The target object on which to define metadata. + * @example + * + * class C { + * } + * + * // constructor + * Reflect.defineMetadata("custom:annotation", options, C); + * + * // decorator factory as metadata-producing annotation. + * function MyAnnotation(options): ClassDecorator { + * return target => Reflect.defineMetadata("custom:annotation", options, target); + * } + * + */ + function defineMetadata(metadataKey: any, metadataValue: any, target: Object): void; + /** + * Define a unique metadata entry on the target. + * @param metadataKey A key used to store and retrieve metadata. + * @param metadataValue A value that contains attached metadata. + * @param target The target object on which to define metadata. + * @param targetKey The property key for the target. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * Reflect.defineMetadata("custom:annotation", Number, C, "staticProperty"); + * + * // property (on prototype) + * Reflect.defineMetadata("custom:annotation", Number, C.prototype, "property"); + * + * // method (on constructor) + * Reflect.defineMetadata("custom:annotation", Number, C, "staticMethod"); + * + * // method (on prototype) + * Reflect.defineMetadata("custom:annotation", Number, C.prototype, "method"); + * + * // decorator factory as metadata-producing annotation. + * function MyAnnotation(options): PropertyDecorator { + * return (target, key) => Reflect.defineMetadata("custom:annotation", options, target, key); + * } + * + */ + function defineMetadata(metadataKey: any, metadataValue: any, target: Object, targetKey: string | symbol): void; + /** + * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. + * @example + * + * class C { + * } + * + * // constructor + * result = Reflect.hasMetadata("custom:annotation", C); + * + */ + function hasMetadata(metadataKey: any, target: Object): boolean; + /** + * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey The property key for the target. + * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * result = Reflect.hasMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasMetadata("custom:annotation", C.prototype, "method"); + * + */ + function hasMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean; + /** + * Gets a value indicating whether the target object has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. + * @example + * + * class C { + * } + * + * // constructor + * result = Reflect.hasOwnMetadata("custom:annotation", C); + * + */ + function hasOwnMetadata(metadataKey: any, target: Object): boolean; + /** + * Gets a value indicating whether the target object has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey The property key for the target. + * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", C.prototype, "method"); + * + */ + function hasOwnMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean; + /** + * Gets the metadata value for the provided metadata key on the target object or its prototype chain. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class C { + * } + * + * // constructor + * result = Reflect.getMetadata("custom:annotation", C); + * + */ + function getMetadata(metadataKey: any, target: Object): any; + /** + * Gets the metadata value for the provided metadata key on the target object or its prototype chain. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * result = Reflect.getMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadata("custom:annotation", C.prototype, "method"); + * + */ + function getMetadata(metadataKey: any, target: Object, targetKey: string | symbol): any; + /** + * Gets the metadata value for the provided metadata key on the target object. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class C { + * } + * + * // constructor + * result = Reflect.getOwnMetadata("custom:annotation", C); + * + */ + function getOwnMetadata(metadataKey: any, target: Object): any; + /** + * Gets the metadata value for the provided metadata key on the target object. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", C.prototype, "method"); + * + */ + function getOwnMetadata(metadataKey: any, target: Object, targetKey: string | symbol): any; + /** + * Gets the metadata keys defined on the target object or its prototype chain. + * @param target The target object on which the metadata is defined. + * @returns An array of unique metadata keys. + * @example + * + * class C { + * } + * + * // constructor + * result = Reflect.getMetadataKeys(C); + * + */ + function getMetadataKeys(target: Object): any[]; + /** + * Gets the metadata keys defined on the target object or its prototype chain. + * @param target The target object on which the metadata is defined. + * @param targetKey The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * result = Reflect.getMetadataKeys(C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadataKeys(C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadataKeys(C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadataKeys(C.prototype, "method"); + * + */ + function getMetadataKeys(target: Object, targetKey: string | symbol): any[]; + /** + * Gets the unique metadata keys defined on the target object. + * @param target The target object on which the metadata is defined. + * @returns An array of unique metadata keys. + * @example + * + * class C { + * } + * + * // constructor + * result = Reflect.getOwnMetadataKeys(C); + * + */ + function getOwnMetadataKeys(target: Object): any[]; + /** + * Gets the unique metadata keys defined on the target object. + * @param target The target object on which the metadata is defined. + * @param targetKey The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * result = Reflect.getOwnMetadataKeys(C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadataKeys(C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadataKeys(C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadataKeys(C.prototype, "method"); + * + */ + function getOwnMetadataKeys(target: Object, targetKey: string | symbol): any[]; + /** + * Deletes the metadata entry from the target object with the provided key. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @returns `true` if the metadata entry was found and deleted; otherwise, false. + * @example + * + * class C { + * } + * + * // constructor + * result = Reflect.deleteMetadata("custom:annotation", C); + * + */ + function deleteMetadata(metadataKey: any, target: Object): boolean; + /** + * Deletes the metadata entry from the target object with the provided key. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param targetKey The property key for the target. + * @returns `true` if the metadata entry was found and deleted; otherwise, false. + * @example + * + * class C { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", C, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", C.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", C, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", C.prototype, "method"); + * + */ + function deleteMetadata(metadataKey: any, target: Object, targetKey: string | symbol): boolean; +} diff --git a/src/Jackett.Web/typings/semantic-ui.d.ts b/src/Jackett.Web/typings/semantic-ui.d.ts new file mode 100644 index 000000000..8853dc2d4 --- /dev/null +++ b/src/Jackett.Web/typings/semantic-ui.d.ts @@ -0,0 +1,12 @@ + +interface JQuery { + dropdown(): JQuery +} + +interface JQueryStatic { + dropdown(): JQuery +} + +interface Element { + value: any; +} \ No newline at end of file diff --git a/src/Jackett.Web/typings/whatwg-fetch.d.ts b/src/Jackett.Web/typings/whatwg-fetch.d.ts new file mode 100644 index 000000000..62e071bb4 --- /dev/null +++ b/src/Jackett.Web/typings/whatwg-fetch.d.ts @@ -0,0 +1,88 @@ +// Type definitions for fetch API +// Project: https://github.com/github/fetch +// Definitions by: Ryan Graham +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// @cmichaelgraham - removed explicit external reference + +// @cmichaelgraham - added BufferSource and URLSearchParams interfaces to help compilation +interface BufferSource {} +interface URLSearchParams {} + +declare class Request { + constructor(input: string|Request, init?:RequestInit); + method: string; + url: string; + headers: Headers; + context: RequestContext; + referrer: string; + mode: RequestMode; + credentials: RequestCredentials; + cache: RequestCache; +} + +interface RequestInit { + method?: string; + headers?: HeaderInit|{ [index: string]: string }; + body?: BodyInit; + mode?: RequestMode; + credentials?: RequestCredentials; + cache?: RequestCache; +} + +declare enum RequestContext { + "audio", "beacon", "cspreport", "download", "embed", "eventsource", "favicon", "fetch", + "font", "form", "frame", "hyperlink", "iframe", "image", "imageset", "import", + "internal", "location", "manifest", "object", "ping", "plugin", "prefetch", "script", + "serviceworker", "sharedworker", "subresource", "style", "track", "video", "worker", + "xmlhttprequest", "xslt" +} +declare enum RequestMode { "same-origin", "no-cors", "cors" } +declare enum RequestCredentials { "omit", "same-origin", "include" } +declare enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" } + +declare class Headers { + append(name: string, value: string): void; + delete(name: string):void; + get(name: string): string; + getAll(name: string): Array; + has(name: string): boolean; + set(name: string, value: string): void; +} + +declare class Body { + bodyUsed: boolean; + arrayBuffer(): Promise; + blob(): Promise; + formData(): Promise; + json(): Promise; + text(): Promise; +} +declare class Response extends Body { + constructor(body?: BodyInit, init?: ResponseInit); + error(): Response; + redirect(url: string, status: number): Response; + type: ResponseType; + url: string; + status: number; + ok: boolean; + statusText: string; + headers: Headers; + clone(): Response; +} + +declare enum ResponseType { "basic", "cors", "default", "error", "opaque" } + +declare class ResponseInit { + status: number; + statusText: string; + headers: HeaderInit; +} + +declare type HeaderInit = Headers|Array; +declare type BodyInit = Blob|FormData|string; +declare type RequestInfo = Request|string; + +interface Window { + fetch(url: string, init?: RequestInit): Promise; +} diff --git a/src/Jackett.Web/views/Indexers.html b/src/Jackett.Web/views/Indexers.html new file mode 100644 index 000000000..2a2708809 --- /dev/null +++ b/src/Jackett.Web/views/Indexers.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/src/Jackett.Web/views/Indexers.js b/src/Jackett.Web/views/Indexers.js new file mode 100644 index 000000000..daba4a82e --- /dev/null +++ b/src/Jackett.Web/views/Indexers.js @@ -0,0 +1,45 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) { + return new Promise(function (resolve, reject) { + generator = generator.call(thisArg, _arguments); + function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); } + function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } + function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } + function step(verb, value) { + var result = generator[verb](value); + result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); + } + step("next", void 0); + }); +}; +import 'jquery'; +import 'ms-signalr-client'; +import 'jackett-hubs'; +import { AutoDLService } from '../Services/AutoDLService'; +import { autoinject } from 'aurelia-framework'; +export let Indexers = class { + constructor(a) { + this.autodlService = a; + } + activate(params) { + return this.autodlService.getProfiles() + .then(profiles => { + this.autodlProfiles = profiles; + }); + } +}; +Indexers = __decorate([ + autoinject, + __metadata('design:paramtypes', [AutoDLService]) +], Indexers); +//# sourceMappingURL=Indexers.js.map \ No newline at end of file diff --git a/src/Jackett.Web/views/Indexers.js.map b/src/Jackett.Web/views/Indexers.js.map new file mode 100644 index 000000000..277df7787 --- /dev/null +++ b/src/Jackett.Web/views/Indexers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Indexers.js","sourceRoot":"","sources":["Indexers.ts"],"names":["Indexers","Indexers.constructor","Indexers.activate"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;OAAO,QAAQ;OACR,mBAAmB;OACnB,cAAc;OACd,EAAC,aAAa,EAAgB,MAAM,2BAA2B;OAC/D,EAAC,UAAU,EAAC,MAAM,mBAAmB;AAE5C;IAKIA,YAAYA,CAAgBA;QACxBC,IAAIA,CAACA,aAAaA,GAAGA,CAACA,CAACA;IAC3BA,CAACA;IAEDD,QAAQA,CAACA,MAAWA;QAChBE,MAAMA,CAACA,IAAIA,CAACA,aAAaA,CAACA,WAAWA,EAAEA;aAClCA,IAAIA,CAACA,QAAQA;YACVA,IAAIA,CAACA,cAAcA,GAAGA,QAAQA,CAACA;QACnCA,CAACA,CAACA,CAAAA;IACVA,CAACA;AACLF,CAACA;AAfD;IAAC,UAAU;;aAeV;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/views/Indexers.ts b/src/Jackett.Web/views/Indexers.ts new file mode 100644 index 000000000..b0aa87e6a --- /dev/null +++ b/src/Jackett.Web/views/Indexers.ts @@ -0,0 +1,22 @@ +import 'jquery'; +import 'ms-signalr-client'; +import 'jackett-hubs'; +import {AutoDLService, AutoDLProfile} from '../Services/AutoDLService' +import {autoinject} from 'aurelia-framework'; + +@autoinject +export class Indexers { + autodlService: AutoDLService; + autodlProfiles: AutoDLProfile[]; + + constructor(a: AutoDLService) { + this.autodlService = a; + } + + activate(params: any) { + return this.autodlService.getProfiles() + .then(profiles => { + this.autodlProfiles = profiles; + }) + } +} \ No newline at end of file diff --git a/src/Jackett.Web/views/add-indexer.html b/src/Jackett.Web/views/add-indexer.html new file mode 100644 index 000000000..f48040423 --- /dev/null +++ b/src/Jackett.Web/views/add-indexer.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/src/Jackett.Web/views/add-indexer.js b/src/Jackett.Web/views/add-indexer.js new file mode 100644 index 000000000..2c9952d2c --- /dev/null +++ b/src/Jackett.Web/views/add-indexer.js @@ -0,0 +1 @@ +//# sourceMappingURL=add-indexer.js.map \ No newline at end of file diff --git a/src/Jackett.Web/views/add-indexer.js.map b/src/Jackett.Web/views/add-indexer.js.map new file mode 100644 index 000000000..00f4d067b --- /dev/null +++ b/src/Jackett.Web/views/add-indexer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"add-indexer.js","sourceRoot":"","sources":["add-indexer.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/src/Jackett.Web/views/add-indexer.ts b/src/Jackett.Web/views/add-indexer.ts new file mode 100644 index 000000000..5f282702b --- /dev/null +++ b/src/Jackett.Web/views/add-indexer.ts @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/Jackett.Web/views/autodlprofile-configure.html b/src/Jackett.Web/views/autodlprofile-configure.html new file mode 100644 index 000000000..566d00a21 --- /dev/null +++ b/src/Jackett.Web/views/autodlprofile-configure.html @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/src/Jackett.Web/views/autodlprofile-configure.js b/src/Jackett.Web/views/autodlprofile-configure.js new file mode 100644 index 000000000..1a9092570 --- /dev/null +++ b/src/Jackett.Web/views/autodlprofile-configure.js @@ -0,0 +1,98 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) { + return new Promise(function (resolve, reject) { + generator = generator.call(thisArg, _arguments); + function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); } + function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } + function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } + function step(verb, value) { + var result = generator[verb](value); + result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); + } + step("next", void 0); + }); +}; +import 'jquery'; +import 'ms-signalr-client'; +import 'jackett-hubs'; +import { AutoDLService } from '../Services/AutoDLService'; +import { autoinject } from 'aurelia-framework'; +import { Router } from 'aurelia-router'; +export let AutoDLProfileConfigure = class { + constructor(a, r) { + this.autodlService = a; + this.router = r; + } + activate(params) { + return this.autodlService.getProfiles() + .then(profiles => { + this.profile = profiles.filter(p => p.Type == params.type)[0]; + this.profile.Options.forEach(opt => { + if (opt.Value === null) { + opt.Value = opt.DefaultValue; + } + if (opt.Type === 'Bool' && opt.Value !== null) { + opt.Value = opt.Value.toLowerCase() === 'true'; + } + }); + }); + } + attached() { + var vm = this; + $(this.form).find('input').on('paste', function (e) { + // We get this event before the data is applied, so wait a bit :/ + setTimeout(() => { + var fieldName = $(e.target).attr('data-fieldname'); + var value = $(e.target).val(); + // Find by fieldname + vm.profile.Options.forEach(opt => { + if (opt.Name === fieldName) { + // If we have a paste group + if (opt.PasteGroup !== null) { + opt.PasteGroup.split(',').forEach(i => { + i = $.trim(i); + // Loop over each item in the paste group and apply + vm.profile.Options.forEach(o => { + if (o.Name === i && o.PasteRegex !== null) { + var regex = new RegExp(o.PasteRegex, "i"); + var match = regex.exec(value); + debugger; + if (match !== null && match.length > 0) { + o.Value = match[1]; + } + } + }); + }); + } + } + }); + }, 50); + }); + } + submit() { + return __awaiter(this, void 0, Promise, function* () { + //await this.validation.validate(); + // try { + yield this.autodlService.saveProfile(this.profile); + this.router.navigate('indexers'); + // } catch (e) { + //this.error = 'There was an error submiting your changes'; + // } + }); + } +}; +AutoDLProfileConfigure = __decorate([ + autoinject, + __metadata('design:paramtypes', [AutoDLService, Router]) +], AutoDLProfileConfigure); +//# sourceMappingURL=autodlprofile-configure.js.map \ No newline at end of file diff --git a/src/Jackett.Web/views/autodlprofile-configure.js.map b/src/Jackett.Web/views/autodlprofile-configure.js.map new file mode 100644 index 000000000..84425808e --- /dev/null +++ b/src/Jackett.Web/views/autodlprofile-configure.js.map @@ -0,0 +1 @@ +{"version":3,"file":"autodlprofile-configure.js","sourceRoot":"","sources":["autodlprofile-configure.ts"],"names":["AutoDLProfileConfigure","AutoDLProfileConfigure.constructor","AutoDLProfileConfigure.activate","AutoDLProfileConfigure.attached","AutoDLProfileConfigure.submit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;OAAO,QAAQ;OACR,mBAAmB;OACnB,cAAc;OACd,EAAC,aAAa,EAAgB,MAAM,2BAA2B;OAC/D,EAAC,UAAU,EAAC,MAAM,mBAAmB;OACrC,EAAC,MAAM,EAAC,MAAM,gBAAgB;AAErC;IAQIA,YAAYA,CAAgBA,EAAEA,CAASA;QACnCC,IAAIA,CAACA,aAAaA,GAAGA,CAACA,CAACA;QACvBA,IAAIA,CAACA,MAAMA,GAAGA,CAACA,CAACA;IACpBA,CAACA;IAEDD,QAAQA,CAACA,MAAWA;QAChBE,MAAMA,CAACA,IAAIA,CAACA,aAAaA,CAACA,WAAWA,EAAEA;aAClCA,IAAIA,CAACA,QAAQA;YACVA,IAAIA,CAACA,OAAOA,GAAGA,QAAQA,CAACA,MAAMA,CAACA,CAACA,IAAGA,CAACA,CAACA,IAAIA,IAAIA,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA,CAACA;YAE7DA,IAAIA,CAACA,OAAOA,CAACA,OAAOA,CAACA,OAAOA,CAACA,GAAGA;gBAC5BA,EAAEA,CAACA,CAACA,GAAGA,CAACA,KAAKA,KAAKA,IAAIA,CAACA,CAACA,CAACA;oBACrBA,GAAGA,CAACA,KAAKA,GAAGA,GAAGA,CAACA,YAAYA,CAACA;gBACjCA,CAACA;gBAEDA,EAAEA,CAACA,CAACA,GAAGA,CAACA,IAAIA,KAAKA,MAAMA,IAAIA,GAAGA,CAACA,KAAKA,KAAGA,IAAIA,CAACA,CAACA,CAACA;oBAC1CA,GAAGA,CAACA,KAAKA,GAAGA,GAAGA,CAACA,KAAKA,CAACA,WAAWA,EAAEA,KAAKA,MAAMA,CAACA;gBACnDA,CAACA;YACLA,CAACA,CAACA,CAACA;QACPA,CAACA,CAACA,CAAAA;IACVA,CAACA;IAEDF,QAAQA;QACJG,IAAIA,EAAEA,GAAGA,IAAIA,CAACA;QACdA,CAACA,CAACA,IAAIA,CAACA,IAAIA,CAACA,CAACA,IAAIA,CAACA,OAAOA,CAACA,CAACA,EAAEA,CAACA,OAAOA,EAAEA,UAAUA,CAACA;YAC9C,iEAAiE;YACjE,UAAU,CAAC;gBACP,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;gBACnD,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC;gBAC9B,oBAAoB;gBACpB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG;oBAC1B,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;wBACzB,2BAA2B;wBAC3B,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC;4BAC1B,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;gCAC/B,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gCACd,mDAAmD;gCACnD,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;oCACxB,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC;wCACxC,IAAI,KAAK,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;wCAC1C,IAAI,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;wCAC9B,QAAQ,CAAC;wCACT,EAAE,CAAC,CAAC,KAAK,KAAG,IAAI,IAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;4CAClC,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;wCACvB,CAAC;oCACL,CAAC;gCACL,CAAC,CAAC,CAAC;4BACP,CAAC,CAAC,CAAC;wBACP,CAAC;oBACL,CAAC;gBACL,CAAC,CAAC,CAAC;YACP,CAAC,EAAC,EAAE,CAAC,CAAC;QACV,CAAC,CAACA,CAACA;IACPA,CAACA;IAGKH,MAAMA;;YAERI,mCAAmCA;YAErCA,SAASA;YACHA,MAAMA,IAAIA,CAACA,aAAaA,CAACA,WAAWA,CAACA,IAAIA,CAACA,OAAOA,CAACA,CAACA;YACnDA,IAAIA,CAACA,MAAMA,CAACA,QAAQA,CAACA,UAAUA,CAACA,CAACA;YAEtCA,gBAAgBA;YACXA,2DAA2DA;YACjEA,KAAKA;QACPA,CAACA;KAAAJ;AACLA,CAACA;AA5ED;IAAC,UAAU;;2BA4EV;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/views/autodlprofile-configure.ts b/src/Jackett.Web/views/autodlprofile-configure.ts new file mode 100644 index 000000000..57a187299 --- /dev/null +++ b/src/Jackett.Web/views/autodlprofile-configure.ts @@ -0,0 +1,84 @@ +import 'jquery'; +import 'ms-signalr-client'; +import 'jackett-hubs'; +import {AutoDLService, AutoDLProfile} from '../Services/AutoDLService' +import {autoinject} from 'aurelia-framework'; +import {Router} from 'aurelia-router'; + +@autoinject +export class AutoDLProfileConfigure { + autodlService: AutoDLService; + profile: AutoDLProfile; + router: Router; + + form: any; + + constructor(a: AutoDLService, r: Router) { + this.autodlService = a; + this.router = r; + } + + activate(params: any) { + return this.autodlService.getProfiles() + .then(profiles => { + this.profile = profiles.filter(p=> p.Type == params.type)[0]; + + this.profile.Options.forEach(opt=> { + if (opt.Value === null) { + opt.Value = opt.DefaultValue; + } + + if (opt.Type === 'Bool' && opt.Value!==null) { + opt.Value = opt.Value.toLowerCase() === 'true'; + } + }); + }) + } + + attached() { + var vm = this; + $(this.form).find('input').on('paste', function (e) { + // We get this event before the data is applied, so wait a bit :/ + setTimeout(() => { + var fieldName = $(e.target).attr('data-fieldname'); + var value = $(e.target).val(); + // Find by fieldname + vm.profile.Options.forEach(opt=> { + if (opt.Name === fieldName) { + // If we have a paste group + if (opt.PasteGroup !== null) { + opt.PasteGroup.split(',').forEach(i=> { + i = $.trim(i); + // Loop over each item in the paste group and apply + vm.profile.Options.forEach(o=> { + if (o.Name === i && o.PasteRegex !== null) { + var regex = new RegExp(o.PasteRegex, "i"); + var match = regex.exec(value); + debugger; + if (match!==null&& match.length > 0) { + o.Value = match[1]; + } + } + }); + }); + } + } + }); + },50); + }); + } + + + async submit() { + + //await this.validation.validate(); + + // try { + await this.autodlService.saveProfile(this.profile); + this.router.navigate('indexers'); + + // } catch (e) { + //this.error = 'There was an error submiting your changes'; + // } + } +} \ No newline at end of file diff --git a/src/Jackett.Web/views/home.html b/src/Jackett.Web/views/home.html new file mode 100644 index 000000000..383f2979d --- /dev/null +++ b/src/Jackett.Web/views/home.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/Jackett.Web/views/home.js b/src/Jackett.Web/views/home.js new file mode 100644 index 000000000..d017629f6 --- /dev/null +++ b/src/Jackett.Web/views/home.js @@ -0,0 +1,19 @@ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) { + return new Promise(function (resolve, reject) { + generator = generator.call(thisArg, _arguments); + function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); } + function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } + function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } + function step(verb, value) { + var result = generator[verb](value); + result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); + } + step("next", void 0); + }); +}; +import 'jquery'; +import 'ms-signalr-client'; +import 'jackett-hubs'; +export class App { +} +//# sourceMappingURL=home.js.map \ No newline at end of file diff --git a/src/Jackett.Web/views/home.js.map b/src/Jackett.Web/views/home.js.map new file mode 100644 index 000000000..12fa85539 --- /dev/null +++ b/src/Jackett.Web/views/home.js.map @@ -0,0 +1 @@ +{"version":3,"file":"home.js","sourceRoot":"","sources":["home.ts"],"names":["App"],"mappings":";;;;;;;;;;;;;OAAO,QAAQ;OACR,mBAAmB;OACnB,cAAc;AAErB;AAEAA,CAACA;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/views/home.ts b/src/Jackett.Web/views/home.ts new file mode 100644 index 000000000..86d20f8ab --- /dev/null +++ b/src/Jackett.Web/views/home.ts @@ -0,0 +1,7 @@ +import 'jquery'; +import 'ms-signalr-client'; +import 'jackett-hubs'; + +export class App { + +} \ No newline at end of file diff --git a/src/Jackett.Web/views/irc-settings-edit.html b/src/Jackett.Web/views/irc-settings-edit.html new file mode 100644 index 000000000..e8317d4e8 --- /dev/null +++ b/src/Jackett.Web/views/irc-settings-edit.html @@ -0,0 +1,37 @@ + \ No newline at end of file diff --git a/src/Jackett.Web/views/irc-settings-edit.js b/src/Jackett.Web/views/irc-settings-edit.js new file mode 100644 index 000000000..6f3c43d10 --- /dev/null +++ b/src/Jackett.Web/views/irc-settings-edit.js @@ -0,0 +1,105 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) { + return new Promise(function (resolve, reject) { + generator = generator.call(thisArg, _arguments); + function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); } + function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } + function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } + function step(verb, value) { + var result = generator[verb](value); + result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); + } + step("next", void 0); + }); +}; +import { autoinject } from 'aurelia-framework'; +import { Validation } from 'aurelia-validation'; +import { IRCProfileService, IRCProfile } from '../Services/IRCProfileService'; +import 'jquery'; +import 'semantic-ui'; +import { Router } from 'aurelia-router'; +export let IRCSettings = class { + constructor(httpClient, validation, r) { + this.ircService = httpClient; + this.router = r; + this.validation = validation.on(this, undefined) + .ensure('autodlnetwork') + .isNotEmpty() + .ensure('name') + .isNotEmpty() + .ensure('nickname') + .isNotEmpty(); + } + activate(params) { + var actions = [ + this.ircService.getAutoDLProfiles() + .then(profiles => { + this.networks = profiles; + }) + ]; + if (params.name) { + actions.push(this.ircService.getProfile(params.name).then(profile => { + this.autodlnetwork = profile.Profile; + this.name = profile.Name; + this.nickname = profile.Username; + this.id = profile.Id; + this.servers = profile.Servers; + })); + } + return Promise.all(actions); + } + attached() { + var vm = this; + $(this.profileSelect).val(this.autodlnetwork).dropdown().on('change', e => { + this.autodlnetwork = this.name = e.target.value; + vm.servers = []; + vm.networks.forEach(n => { + if (n.Name === e.target.value) { + vm.servers = n.Servers; + } + }); + }); + } + removeServer(index) { + this.servers.splice(index, 1); + } + addButton() { + if (this.servers === undefined) { + this.servers = []; + } + this.servers.push(''); + } + submit() { + return __awaiter(this, void 0, Promise, function* () { + yield this.validation.validate(); + try { + var profile = new IRCProfile(); + profile.Name = this.name; + profile.Username = this.nickname; + profile.Profile = this.autodlnetwork; + profile.Id = this.id; + profile.Servers = this.servers; + yield this.ircService.setProfile(profile); + this.router.navigate('irc-settings'); + } + catch (e) { + this.error = 'There was an error submiting your changes'; + } + }); + } +}; +IRCSettings = __decorate([ + autoinject, + __metadata('design:paramtypes', [IRCProfileService, Validation, Router]) +], IRCSettings); +//# sourceMappingURL=irc-settings-edit.js.map \ No newline at end of file diff --git a/src/Jackett.Web/views/irc-settings-edit.js.map b/src/Jackett.Web/views/irc-settings-edit.js.map new file mode 100644 index 000000000..6119aa472 --- /dev/null +++ b/src/Jackett.Web/views/irc-settings-edit.js.map @@ -0,0 +1 @@ +{"version":3,"file":"irc-settings-edit.js","sourceRoot":"","sources":["irc-settings-edit.ts"],"names":["IRCSettings","IRCSettings.constructor","IRCSettings.activate","IRCSettings.attached","IRCSettings.removeServer","IRCSettings.addButton","IRCSettings.submit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;OACO,EAAC,UAAU,EAAC,MAAM,mBAAmB;OACrC,EAAC,UAAU,EAAC,MAAM,oBAAoB;OACtC,EAAC,iBAAiB,EAAE,UAAU,EAAiB,MAAM,+BAA+B;OACpF,QAAQ;OACR,aAAa;OACb,EAAC,MAAM,EAAC,MAAM,gBAAgB;AAErC;IAgBIA,YAAaA,UAA6BA,EAAEA,UAAsBA,EAAEA,CAASA;QACzEC,IAAIA,CAACA,UAAUA,GAAGA,UAAUA,CAACA;QAC7BA,IAAIA,CAACA,MAAMA,GAAGA,CAACA,CAACA;QAEhBA,IAAIA,CAACA,UAAUA,GAAGA,UAAUA,CAACA,EAAEA,CAACA,IAAIA,EAAEA,SAASA,CAACA;aAC3CA,MAAMA,CAACA,eAAeA,CAACA;aACvBA,UAAUA,EAAEA;aAEZA,MAAMA,CAACA,MAAMA,CAACA;aACdA,UAAUA,EAAEA;aAEZA,MAAMA,CAACA,UAAUA,CAACA;aAClBA,UAAUA,EAAEA,CAACA;IACtBA,CAACA;IAEDD,QAAQA,CAACA,MAAWA;QAChBE,IAAIA,OAAOA,GAAGA;YACVA,IAAIA,CAACA,UAAUA,CAACA,iBAAiBA,EAAEA;iBAC9BA,IAAIA,CAACA,QAAQA;gBACVA,IAAIA,CAACA,QAAQA,GAAGA,QAAQA,CAACA;YAC7BA,CAACA,CAACA;SACTA,CAACA;QACFA,EAAEA,CAACA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA;YACdA,OAAOA,CAACA,IAAIA,CAACA,IAAIA,CAACA,UAAUA,CAACA,UAAUA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA,IAAIA,CAACA,OAAOA;gBAC7DA,IAAIA,CAACA,aAAaA,GAAGA,OAAOA,CAACA,OAAOA,CAACA;gBACrCA,IAAIA,CAACA,IAAIA,GAAGA,OAAOA,CAACA,IAAIA,CAACA;gBACzBA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA,QAAQA,CAACA;gBACjCA,IAAIA,CAACA,EAAEA,GAAGA,OAAOA,CAACA,EAAEA,CAACA;gBACrBA,IAAIA,CAACA,OAAOA,GAAGA,OAAOA,CAACA,OAAOA,CAACA;YACnCA,CAACA,CAACA,CAACA,CAACA;QACRA,CAACA;QACDA,MAAMA,CAACA,OAAOA,CAACA,GAAGA,CAACA,OAAOA,CAACA,CAACA;IAChCA,CAACA;IAEDF,QAAQA;QACJG,IAAIA,EAAEA,GAAGA,IAAIA,CAACA;QACdA,CAACA,CAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,GAAGA,CAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,QAAQA,EAAEA,CAACA,EAAEA,CAACA,QAAQA,EAAEA,CAACA;YACnEA,IAAIA,CAACA,aAAaA,GAAGA,IAAIA,CAACA,IAAIA,GAAGA,CAACA,CAACA,MAAMA,CAACA,KAAKA,CAACA;YAChDA,EAAEA,CAACA,OAAOA,GAAGA,EAAEA,CAACA;YAChBA,EAAEA,CAACA,QAAQA,CAACA,OAAOA,CAACA,CAACA;gBACjBA,EAAEA,CAACA,CAACA,CAACA,CAACA,IAAIA,KAAKA,CAACA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA,CAACA;oBAC5BA,EAAEA,CAACA,OAAOA,GAAGA,CAACA,CAACA,OAAOA,CAACA;gBAC3BA,CAACA;YACLA,CAACA,CAACA,CAACA;QACPA,CAACA,CAACA,CAACA;IACPA,CAACA;IAEDH,YAAYA,CAACA,KAAaA;QACtBI,IAAIA,CAACA,OAAOA,CAACA,MAAMA,CAACA,KAAKA,EAAEA,CAACA,CAACA,CAACA;IAClCA,CAACA;IAEDJ,SAASA;QACLK,EAAEA,CAACA,CAACA,IAAIA,CAACA,OAAOA,KAAKA,SAASA,CAACA,CAACA,CAACA;YAC7BA,IAAIA,CAACA,OAAOA,GAAGA,EAAEA,CAACA;QACtBA,CAACA;QAEDA,IAAIA,CAACA,OAAOA,CAACA,IAAIA,CAACA,EAAEA,CAACA,CAACA;IAC1BA,CAACA;IAEKL,MAAMA;;YAERM,MAAMA,IAAIA,CAACA,UAAUA,CAACA,QAAQA,EAAEA,CAACA;YAEjCA,IAAIA,CAACA;gBACDA,IAAIA,OAAOA,GAAGA,IAAIA,UAAUA,EAAEA,CAACA;gBAC/BA,OAAOA,CAACA,IAAIA,GAAGA,IAAIA,CAACA,IAAIA,CAACA;gBACzBA,OAAOA,CAACA,QAAQA,GAAGA,IAAIA,CAACA,QAAQA,CAACA;gBACjCA,OAAOA,CAACA,OAAOA,GAAGA,IAAIA,CAACA,aAAaA,CAACA;gBACrCA,OAAOA,CAACA,EAAEA,GAAGA,IAAIA,CAACA,EAAEA,CAACA;gBACrBA,OAAOA,CAACA,OAAOA,GAAGA,IAAIA,CAACA,OAAOA,CAACA;gBAC/BA,MAAMA,IAAIA,CAACA,UAAUA,CAACA,UAAUA,CAACA,OAAOA,CAACA,CAACA;gBAE1CA,IAAIA,CAACA,MAAMA,CAACA,QAAQA,CAACA,cAAcA,CAACA,CAACA;YAEzCA,CAAEA;YAAAA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;gBACTA,IAAIA,CAACA,KAAKA,GAAGA,2CAA2CA,CAACA;YAC7DA,CAACA;QACLA,CAACA;KAAAN;AACLA,CAACA;AA9FD;IAAC,UAAU;;gBA8FV;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/views/irc-settings-edit.ts b/src/Jackett.Web/views/irc-settings-edit.ts new file mode 100644 index 000000000..e3888a62c --- /dev/null +++ b/src/Jackett.Web/views/irc-settings-edit.ts @@ -0,0 +1,103 @@ +import {HttpClient} from 'aurelia-fetch-client' +import {autoinject} from 'aurelia-framework'; +import {Validation} from 'aurelia-validation'; +import {IRCProfileService, IRCProfile, NetworkSummary} from '../Services/IRCProfileService'; +import 'jquery' +import 'semantic-ui'; +import {Router} from 'aurelia-router'; + +@autoinject +export class IRCSettings { + ircService: IRCProfileService; + + networks: NetworkSummary[]; + autodlnetwork: string; + name: string; + nickname: string; + error: string; + id: string; + servers: string[]; + + profileSelect: any; + validation: any; + router: Router; + + constructor( httpClient: IRCProfileService, validation: Validation, r: Router) { + this.ircService = httpClient; + this.router = r; + + this.validation = validation.on(this, undefined) + .ensure('autodlnetwork') + .isNotEmpty() + + .ensure('name') + .isNotEmpty() + + .ensure('nickname') + .isNotEmpty(); + } + + activate(params: any) { + var actions = [ + this.ircService.getAutoDLProfiles() + .then(profiles => { + this.networks = profiles; + }) + ]; + if (params.name) { + actions.push(this.ircService.getProfile(params.name).then(profile=> { + this.autodlnetwork = profile.Profile; + this.name = profile.Name; + this.nickname = profile.Username; + this.id = profile.Id; + this.servers = profile.Servers; + })); + } + return Promise.all(actions); + } + + attached() { + var vm = this; + $(this.profileSelect).val(this.autodlnetwork).dropdown().on('change', e => { + this.autodlnetwork = this.name = e.target.value; + vm.servers = []; + vm.networks.forEach(n=> { + if (n.Name === e.target.value) { + vm.servers = n.Servers; + } + }); + }); + } + + removeServer(index: number) { + this.servers.splice(index, 1); + } + + addButton() { + if (this.servers === undefined) { + this.servers = []; + } + + this.servers.push(''); + } + + async submit() { + + await this.validation.validate(); + + try { + var profile = new IRCProfile(); + profile.Name = this.name; + profile.Username = this.nickname; + profile.Profile = this.autodlnetwork; + profile.Id = this.id; + profile.Servers = this.servers; + await this.ircService.setProfile(profile); + + this.router.navigate('irc-settings'); + + } catch (e) { + this.error = 'There was an error submiting your changes'; + } + } +} \ No newline at end of file diff --git a/src/Jackett.Web/views/irc-settings.html b/src/Jackett.Web/views/irc-settings.html new file mode 100644 index 000000000..2153e0691 --- /dev/null +++ b/src/Jackett.Web/views/irc-settings.html @@ -0,0 +1,34 @@ + \ No newline at end of file diff --git a/src/Jackett.Web/views/irc-settings.js b/src/Jackett.Web/views/irc-settings.js new file mode 100644 index 000000000..739d43ef8 --- /dev/null +++ b/src/Jackett.Web/views/irc-settings.js @@ -0,0 +1,53 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) { + return new Promise(function (resolve, reject) { + generator = generator.call(thisArg, _arguments); + function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); } + function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } + function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } + function step(verb, value) { + var result = generator[verb](value); + result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); + } + step("next", void 0); + }); +}; +import { IRCProfileService } from '../Services/IRCProfileService'; +import { autoinject } from 'aurelia-framework'; +export let IRCSettings = class { + constructor(httpClient) { + this.ircService = httpClient; + } + activate() { + return Promise.all([ + this.ircService.getAutoDLProfiles() + .then(profiles => { + this.autodlprofiles = profiles; + }), + this.ircService.getProfiles().then(profiles => { + this.profiles = profiles; + }) + ]); + } + remove(item) { + return __awaiter(this, void 0, Promise, function* () { + yield this.ircService.removeProfile(item); + this.profiles = yield this.ircService.getProfiles(); + }); + } +}; +IRCSettings = __decorate([ + autoinject, + __metadata('design:paramtypes', [IRCProfileService]) +], IRCSettings); +//# sourceMappingURL=irc-settings.js.map \ No newline at end of file diff --git a/src/Jackett.Web/views/irc-settings.js.map b/src/Jackett.Web/views/irc-settings.js.map new file mode 100644 index 000000000..2c8a9a428 --- /dev/null +++ b/src/Jackett.Web/views/irc-settings.js.map @@ -0,0 +1 @@ +{"version":3,"file":"irc-settings.js","sourceRoot":"","sources":["irc-settings.ts"],"names":["IRCSettings","IRCSettings.constructor","IRCSettings.activate","IRCSettings.remove"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;OAAO,EAAC,iBAAiB,EAA6B,MAAM,+BAA+B;OACpF,EAAC,UAAU,EAAC,MAAM,mBAAmB;AAE5C;IAMIA,YAAYA,UAA6BA;QACrCC,IAAIA,CAACA,UAAUA,GAAGA,UAAUA,CAACA;IACjCA,CAACA;IAEDD,QAAQA;QACJE,MAAMA,CAACA,OAAOA,CAACA,GAAGA,CAACA;YACfA,IAAIA,CAACA,UAAUA,CAACA,iBAAiBA,EAAEA;iBAC9BA,IAAIA,CAACA,QAAQA;gBACVA,IAAIA,CAACA,cAAcA,GAAGA,QAAQA,CAAAA;YAClCA,CAACA,CAACA;YAENA,IAAIA,CAACA,UAAUA,CAACA,WAAWA,EAAEA,CAACA,IAAIA,CAACA,QAAQA;gBACvCA,IAAIA,CAACA,QAAQA,GAAGA,QAAQA,CAAAA;YAC5BA,CAACA,CAACA;SACLA,CAACA,CAACA;IACPA,CAACA;IAEKF,MAAMA,CAACA,IAAIA;;YACbG,MAAMA,IAAIA,CAACA,UAAUA,CAACA,aAAaA,CAACA,IAAIA,CAACA,CAACA;YAC1CA,IAAIA,CAACA,QAAQA,GAAGA,MAAMA,IAAIA,CAACA,UAAUA,CAACA,WAAWA,EAAEA,CAACA;QACxDA,CAACA;KAAAH;AACLA,CAACA;AA3BD;IAAC,UAAU;;gBA2BV;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/views/irc-settings.ts b/src/Jackett.Web/views/irc-settings.ts new file mode 100644 index 000000000..b7bf8ef72 --- /dev/null +++ b/src/Jackett.Web/views/irc-settings.ts @@ -0,0 +1,31 @@ +import {IRCProfileService, IRCProfile, NetworkSummary} from '../Services/IRCProfileService'; +import {autoinject} from 'aurelia-framework'; + +@autoinject +export class IRCSettings { + ircService: IRCProfileService; + profiles: IRCProfile[]; + autodlprofiles: NetworkSummary[]; + + constructor(httpClient: IRCProfileService) { + this.ircService = httpClient; + } + + activate() { + return Promise.all([ + this.ircService.getAutoDLProfiles() + .then(profiles => { + this.autodlprofiles = profiles + }), + + this.ircService.getProfiles().then(profiles => { + this.profiles = profiles + }) + ]); + } + + async remove(item) { + await this.ircService.removeProfile(item); + this.profiles = await this.ircService.getProfiles(); + } +} \ No newline at end of file diff --git a/src/Jackett.Web/views/irc.html b/src/Jackett.Web/views/irc.html new file mode 100644 index 000000000..4e5ce4705 --- /dev/null +++ b/src/Jackett.Web/views/irc.html @@ -0,0 +1,28 @@ + \ No newline at end of file diff --git a/src/Jackett.Web/views/irc.js b/src/Jackett.Web/views/irc.js new file mode 100644 index 000000000..44bb1b8e1 --- /dev/null +++ b/src/Jackett.Web/views/irc.js @@ -0,0 +1,135 @@ +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); + switch (arguments.length) { + case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); + case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); + case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); + } +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) { + return new Promise(function (resolve, reject) { + generator = generator.call(thisArg, _arguments); + function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); } + function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } + function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } + function step(verb, value) { + var result = generator[verb](value); + result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); + } + step("next", void 0); + }); +}; +import { autoinject } from 'aurelia-framework'; +import { IRCService } from '../Services/IRCService'; +import { activationStrategy } from 'aurelia-router'; +import { EventAggregator } from 'aurelia-event-aggregator'; +import 'jquery'; +export let Irc = class { + constructor(ircs, ea) { + this.ircService = ircs; + this.eventAggregator = ea; + } + // Force aurelia to redraw the page + determineActivationStrategy() { + return activationStrategy.replace; + } + attached() { + var irc = this; + this.ircMessageSubscription = this.eventAggregator.subscribe('IRC-Message', msg => { + if (msg.Id === irc.selectedId) { + this.ircService.getMessages(irc.selectedNetworkId, irc.selectedChannelId).then(m => { + this.messages = m; + }); + } + }); + this.ircUsersSubscription = this.eventAggregator.subscribe('IRC-Users', msg => { + if (msg.Id === irc.selectedId) { + this.ircService.getUsers(irc.selectedNetworkId, irc.selectedChannelId).then(users => { + this.users = users; + }); + } + }); + this.ircStateSubscription = this.eventAggregator.subscribe('IRC-State', msg => { + irc.getState(); + }); + } + detached() { + this.ircMessageSubscription(); + this.ircUsersSubscription(); + this.ircStateSubscription(); + } + getState() { + return this.ircService.getState().then(state => { + this.networkStates = state; + if (this.networkStates.length > 0) { + this.onNetworkClick(this.networkStates[0]); + } + }); + } + activate() { + this.getState(); + $('body').addClass('jackett-body-fill'); + } + deactivate() { + $('body').removeClass('jackett-body-fill'); + } + onNetworkClick(network) { + this.selectById(network.Id); + this.selectedChannelId = null; + this.selectedNetworkId = network.Id; + this.users = []; + this.ircService.getMessages(network.Id, null).then(m => { + this.messages = m; + }); + this.ircService.getUsers(network.Id, 'server').then(users => { + this.users = users; + }); + return false; + } + onChannelClick(channel, network) { + this.selectById(channel.Id); + this.selectedChannelId = channel.Id; + this.selectedNetworkId = network.Id; + this.ircService.getMessages(network.Id, channel.Id).then(m => { + this.messages = m; + }); + this.ircService.getUsers(network.Id, channel.Id).then(users => { + this.users = users; + }); + return false; + } + performCommand() { + var networkId = null; + var channelId = null; + this.networkStates.forEach(n => { + if (n.Id == this.selectedId) { + networkId = n.Id; + } + n.Channels.forEach(c => { + if (c.Id == this.selectedId) { + networkId = n.Id; + channelId = c.Id; + } + }); + }); + this.ircService.processCommand(networkId, channelId, this.commandInput.value); + this.commandInput.value = ''; + } + selectById(id) { + this.selectedId = id; + this.networkStates.forEach(n => { + n.IsSelected = n.Id == this.selectedId; + n.Channels.forEach(c => { + c.IsSelected = c.Id == this.selectedId; + }); + }); + } +}; +Irc = __decorate([ + autoinject, + __metadata('design:paramtypes', [IRCService, EventAggregator]) +], Irc); +//# sourceMappingURL=irc.js.map \ No newline at end of file diff --git a/src/Jackett.Web/views/irc.js.map b/src/Jackett.Web/views/irc.js.map new file mode 100644 index 000000000..8ed7c70af --- /dev/null +++ b/src/Jackett.Web/views/irc.js.map @@ -0,0 +1 @@ +{"version":3,"file":"irc.js","sourceRoot":"","sources":["irc.ts"],"names":["Irc","Irc.constructor","Irc.determineActivationStrategy","Irc.attached","Irc.detached","Irc.getState","Irc.activate","Irc.deactivate","Irc.onNetworkClick","Irc.onChannelClick","Irc.performCommand","Irc.selectById"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB;OACrC,EAAC,UAAU,EAAkD,MAAM,wBAAwB;OAE3F,EAAC,kBAAkB,EAAC,MAAM,gBAAgB;OAC1C,EAAC,eAAe,EAAC,MAAM,0BAA0B;OACjD,QAAQ;AAEf;IAkBIA,YAAYA,IAAgBA,EAAEA,EAAmBA;QAC7CC,IAAIA,CAACA,UAAUA,GAAGA,IAAIA,CAACA;QACvBA,IAAIA,CAACA,eAAeA,GAAGA,EAAEA,CAACA;IAC9BA,CAACA;IAEDD,mCAAmCA;IACnCA,2BAA2BA;QACvBE,MAAMA,CAACA,kBAAkBA,CAACA,OAAOA,CAACA;IACtCA,CAACA;IAEDF,QAAQA;QACJG,IAAIA,GAAGA,GAAGA,IAAIA,CAACA;QACfA,IAAIA,CAACA,sBAAsBA,GAAGA,IAAIA,CAACA,eAAeA,CAACA,SAASA,CAACA,aAAaA,EAAEA,GAAGA;YAC3EA,EAAEA,CAACA,CAACA,GAAGA,CAACA,EAAEA,KAAKA,GAAGA,CAACA,UAAUA,CAACA,CAACA,CAACA;gBAC5BA,IAAIA,CAACA,UAAUA,CAACA,WAAWA,CAACA,GAAGA,CAACA,iBAAiBA,EAAEA,GAAGA,CAACA,iBAAiBA,CAACA,CAACA,IAAIA,CAACA,CAACA;oBAC5EA,IAAIA,CAACA,QAAQA,GAAGA,CAACA,CAACA;gBACtBA,CAACA,CAACA,CAACA;YACPA,CAACA;QACLA,CAACA,CAACA,CAACA;QACHA,IAAIA,CAACA,oBAAoBA,GAAGA,IAAIA,CAACA,eAAeA,CAACA,SAASA,CAACA,WAAWA,EAAEA,GAAGA;YACvEA,EAAEA,CAACA,CAACA,GAAGA,CAACA,EAAEA,KAAKA,GAAGA,CAACA,UAAUA,CAACA,CAACA,CAACA;gBAC5BA,IAAIA,CAACA,UAAUA,CAACA,QAAQA,CAACA,GAAGA,CAACA,iBAAiBA,EAAEA,GAAGA,CAACA,iBAAiBA,CAACA,CAACA,IAAIA,CAACA,KAAKA;oBAC7EA,IAAIA,CAACA,KAAKA,GAAGA,KAAKA,CAACA;gBACvBA,CAACA,CAACA,CAACA;YACPA,CAACA;QACLA,CAACA,CAACA,CAACA;QAEHA,IAAIA,CAACA,oBAAoBA,GAAGA,IAAIA,CAACA,eAAeA,CAACA,SAASA,CAACA,WAAWA,EAAEA,GAAGA;YACvEA,GAAGA,CAACA,QAAQA,EAAEA,CAACA;QACnBA,CAACA,CAACA,CAACA;IACPA,CAACA;IAEDH,QAAQA;QACJI,IAAIA,CAACA,sBAAsBA,EAAEA,CAACA;QAC9BA,IAAIA,CAACA,oBAAoBA,EAAEA,CAACA;QAC5BA,IAAIA,CAACA,oBAAoBA,EAAEA,CAACA;IAChCA,CAACA;IAEDJ,QAAQA;QACJK,MAAMA,CAACA,IAAIA,CAACA,UAAUA,CAACA,QAAQA,EAAEA,CAACA,IAAIA,CAACA,KAAKA;YACxCA,IAAIA,CAACA,aAAaA,GAAGA,KAAKA,CAACA;YAC3BA,EAAEA,CAACA,CAACA,IAAIA,CAACA,aAAaA,CAACA,MAAMA,GAAGA,CAACA,CAACA,CAACA,CAACA;gBAChCA,IAAIA,CAACA,cAAcA,CAACA,IAAIA,CAACA,aAAaA,CAACA,CAACA,CAACA,CAACA,CAACA;YAC/CA,CAACA;QACLA,CAACA,CAACA,CAACA;IACPA,CAACA;IAEDL,QAAQA;QACJM,IAAIA,CAACA,QAAQA,EAAEA,CAACA;QAChBA,CAACA,CAACA,MAAMA,CAACA,CAACA,QAAQA,CAACA,mBAAmBA,CAACA,CAACA;IAC5CA,CAACA;IAEDN,UAAUA;QACNO,CAACA,CAACA,MAAMA,CAACA,CAACA,WAAWA,CAACA,mBAAmBA,CAACA,CAACA;IAC/CA,CAACA;IAEDP,cAAcA,CAACA,OAAqBA;QAChCQ,IAAIA,CAACA,UAAUA,CAACA,OAAOA,CAACA,EAAEA,CAACA,CAACA;QAC5BA,IAAIA,CAACA,iBAAiBA,GAAGA,IAAIA,CAACA;QAC9BA,IAAIA,CAACA,iBAAiBA,GAAGA,OAAOA,CAACA,EAAEA,CAACA;QACpCA,IAAIA,CAACA,KAAKA,GAAGA,EAAEA,CAACA;QAChBA,IAAIA,CAACA,UAAUA,CAACA,WAAWA,CAACA,OAAOA,CAACA,EAAEA,EAAEA,IAAIA,CAACA,CAACA,IAAIA,CAACA,CAACA;YAC5CA,IAAIA,CAACA,QAAQA,GAAGA,CAACA,CAACA;QAC1BA,CAACA,CAACA,CAACA;QACHA,IAAIA,CAACA,UAAUA,CAACA,QAAQA,CAACA,OAAOA,CAACA,EAAEA,EAAEA,QAAQA,CAACA,CAACA,IAAIA,CAACA,KAAKA;YACrDA,IAAIA,CAACA,KAAKA,GAAGA,KAAKA,CAACA;QACvBA,CAACA,CAACA,CAACA;QACHA,MAAMA,CAACA,KAAKA,CAACA;IACjBA,CAACA;IAEDR,cAAcA,CAACA,OAAqBA,EAAEA,OAAqBA;QACvDS,IAAIA,CAACA,UAAUA,CAACA,OAAOA,CAACA,EAAEA,CAACA,CAACA;QAC5BA,IAAIA,CAACA,iBAAiBA,GAAGA,OAAOA,CAACA,EAAEA,CAACA;QACpCA,IAAIA,CAACA,iBAAiBA,GAAGA,OAAOA,CAACA,EAAEA,CAACA;QACpCA,IAAIA,CAACA,UAAUA,CAACA,WAAWA,CAACA,OAAOA,CAACA,EAAEA,EAAEA,OAAOA,CAACA,EAAEA,CAACA,CAACA,IAAIA,CAACA,CAACA;YAClDA,IAAIA,CAACA,QAAQA,GAAGA,CAACA,CAACA;QAC1BA,CAACA,CAACA,CAACA;QACHA,IAAIA,CAACA,UAAUA,CAACA,QAAQA,CAACA,OAAOA,CAACA,EAAEA,EAAEA,OAAOA,CAACA,EAAEA,CAACA,CAACA,IAAIA,CAACA,KAAKA;YACvDA,IAAIA,CAACA,KAAKA,GAAGA,KAAKA,CAACA;QACvBA,CAACA,CAACA,CAACA;QACHA,MAAMA,CAACA,KAAKA,CAACA;IACjBA,CAACA;IAEDT,cAAcA;QACVU,IAAIA,SAASA,GAAGA,IAAIA,CAACA;QACrBA,IAAIA,SAASA,GAAGA,IAAIA,CAACA;QACrBA,IAAIA,CAACA,aAAaA,CAACA,OAAOA,CAACA,CAACA;YACxBA,EAAEA,CAACA,CAACA,CAACA,CAACA,EAAEA,IAAIA,IAAIA,CAACA,UAAUA,CAACA,CAACA,CAACA;gBAC1BA,SAASA,GAAGA,CAACA,CAACA,EAAEA,CAACA;YACrBA,CAACA;YACDA,CAACA,CAACA,QAAQA,CAACA,OAAOA,CAACA,CAACA;gBAChBA,EAAEA,CAACA,CAACA,CAACA,CAACA,EAAEA,IAAIA,IAAIA,CAACA,UAAUA,CAACA,CAACA,CAACA;oBAC1BA,SAASA,GAAGA,CAACA,CAACA,EAAEA,CAACA;oBACjBA,SAASA,GAAGA,CAACA,CAACA,EAAEA,CAACA;gBACrBA,CAACA;YACLA,CAACA,CAACA,CAACA;QACPA,CAACA,CAACA,CAACA;QAEHA,IAAIA,CAACA,UAAUA,CAACA,cAAcA,CAACA,SAASA,EAAEA,SAASA,EAAEA,IAAIA,CAACA,YAAYA,CAACA,KAAKA,CAACA,CAACA;QAC9EA,IAAIA,CAACA,YAAYA,CAACA,KAAKA,GAAGA,EAAEA,CAACA;IACjCA,CAACA;IAEOV,UAAUA,CAACA,EAAUA;QACzBW,IAAIA,CAACA,UAAUA,GAAGA,EAAEA,CAACA;QACrBA,IAAIA,CAACA,aAAaA,CAACA,OAAOA,CAACA,CAACA;YACxBA,CAACA,CAACA,UAAUA,GAAGA,CAACA,CAACA,EAAEA,IAAIA,IAAIA,CAACA,UAAUA,CAACA;YACvCA,CAACA,CAACA,QAAQA,CAACA,OAAOA,CAACA,CAACA;gBAChBA,CAACA,CAACA,UAAUA,GAAGA,CAACA,CAACA,EAAEA,IAAIA,IAAIA,CAACA,UAAUA,CAACA;YAC3CA,CAACA,CAACA,CAACA;QACPA,CAACA,CAACA,CAACA;IACPA,CAACA;AACLX,CAACA;AAjID;IAAC,UAAU;;QAiIV;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/views/irc.ts b/src/Jackett.Web/views/irc.ts new file mode 100644 index 000000000..41a0dcce2 --- /dev/null +++ b/src/Jackett.Web/views/irc.ts @@ -0,0 +1,137 @@ +import {autoinject} from 'aurelia-framework'; +import {IRCService, NetworkState, ChannelState, IRCMessage, IRCUser} from '../Services/IRCService'; +import {HttpClient} from 'aurelia-fetch-client' +import {activationStrategy} from 'aurelia-router' +import {EventAggregator} from 'aurelia-event-aggregator'; +import 'jquery' + +@autoinject +export class Irc { + ircService: IRCService; + eventAggregator: EventAggregator; + + networkStates: NetworkState[]; + messages: IRCMessage[]; + users: IRCUser[]; + + selectedId: string; + selectedChannelId: string; + selectedNetworkId: string; + + commandInput: any; + ircMessageSubscription: any; + ircUsersSubscription: any; + ircStateSubscription: any; + + constructor(ircs: IRCService, ea: EventAggregator) { + this.ircService = ircs; + this.eventAggregator = ea; + } + + // Force aurelia to redraw the page + determineActivationStrategy() { + return activationStrategy.replace; + } + + attached() { + var irc = this; + this.ircMessageSubscription = this.eventAggregator.subscribe('IRC-Message', msg => { + if (msg.Id === irc.selectedId) { + this.ircService.getMessages(irc.selectedNetworkId, irc.selectedChannelId).then(m=> { + this.messages = m; + }); + } + }); + this.ircUsersSubscription = this.eventAggregator.subscribe('IRC-Users', msg => { + if (msg.Id === irc.selectedId) { + this.ircService.getUsers(irc.selectedNetworkId, irc.selectedChannelId).then(users=> { + this.users = users; + }); + } + }); + + this.ircStateSubscription = this.eventAggregator.subscribe('IRC-State', msg => { + irc.getState(); + }); + } + + detached() { + this.ircMessageSubscription(); + this.ircUsersSubscription(); + this.ircStateSubscription(); + } + + getState() { + return this.ircService.getState().then(state=> { + this.networkStates = state; + if (this.networkStates.length > 0) { + this.onNetworkClick(this.networkStates[0]); + } + }); + } + + activate() { + this.getState(); + $('body').addClass('jackett-body-fill'); + } + + deactivate() { + $('body').removeClass('jackett-body-fill'); + } + + onNetworkClick(network: NetworkState) { + this.selectById(network.Id); + this.selectedChannelId = null; + this.selectedNetworkId = network.Id; + this.users = []; + this.ircService.getMessages(network.Id, null).then(m=> { + this.messages = m; + }); + this.ircService.getUsers(network.Id, 'server').then(users=> { + this.users = users; + }); + return false; + } + + onChannelClick(channel: ChannelState, network: NetworkState) { + this.selectById(channel.Id); + this.selectedChannelId = channel.Id; + this.selectedNetworkId = network.Id; + this.ircService.getMessages(network.Id, channel.Id).then(m=> { + this.messages = m; + }); + this.ircService.getUsers(network.Id, channel.Id).then(users=> { + this.users = users; + }); + return false; + } + + performCommand() { + var networkId = null; + var channelId = null; + this.networkStates.forEach(n=> { + if (n.Id == this.selectedId) { + networkId = n.Id; + } + n.Channels.forEach(c=> { + if (c.Id == this.selectedId) { + networkId = n.Id; + channelId = c.Id; + } + }); + }); + + this.ircService.processCommand(networkId, channelId, this.commandInput.value); + this.commandInput.value = ''; + } + + private selectById(id: string) { + this.selectedId = id; + this.networkStates.forEach(n=> { + n.IsSelected = n.Id == this.selectedId; + n.Channels.forEach(c=> { + c.IsSelected = c.Id == this.selectedId; + }); + }); + } +} \ No newline at end of file diff --git a/src/Jackett.Web/views/settings.html b/src/Jackett.Web/views/settings.html new file mode 100644 index 000000000..383f2979d --- /dev/null +++ b/src/Jackett.Web/views/settings.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/src/Jackett.Web/views/settings.js b/src/Jackett.Web/views/settings.js new file mode 100644 index 000000000..78a8aa3bc --- /dev/null +++ b/src/Jackett.Web/views/settings.js @@ -0,0 +1,16 @@ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) { + return new Promise(function (resolve, reject) { + generator = generator.call(thisArg, _arguments); + function cast(value) { return value instanceof Promise && value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); } + function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } + function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } + function step(verb, value) { + var result = generator[verb](value); + result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); + } + step("next", void 0); + }); +}; +export class Settings { +} +//# sourceMappingURL=settings.js.map \ No newline at end of file diff --git a/src/Jackett.Web/views/settings.js.map b/src/Jackett.Web/views/settings.js.map new file mode 100644 index 000000000..841036f72 --- /dev/null +++ b/src/Jackett.Web/views/settings.js.map @@ -0,0 +1 @@ +{"version":3,"file":"settings.js","sourceRoot":"","sources":["settings.ts"],"names":["Settings"],"mappings":";;;;;;;;;;;;;AAAA;AAEAA,CAACA;AAAA"} \ No newline at end of file diff --git a/src/Jackett.Web/views/settings.ts b/src/Jackett.Web/views/settings.ts new file mode 100644 index 000000000..0fc9bef48 --- /dev/null +++ b/src/Jackett.Web/views/settings.ts @@ -0,0 +1,3 @@ +export class Settings { + +} \ No newline at end of file diff --git a/src/Jackett.sln b/src/Jackett.sln index 587f30ce4..fc9c9dc94 100644 --- a/src/Jackett.sln +++ b/src/Jackett.sln @@ -1,107 +1,119 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett", "Jackett\Jackett.csproj", "{E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CurlSharp", "CurlSharp\CurlSharp.csproj", "{74420A79-CC16-442C-8B1E-7C1B913844F0}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BE7B0C8A-6144-47CD-821E-B09BA1B7BADE}" - ProjectSection(SolutionItems) = preProject - ..\Build.bat = ..\Build.bat - ..\Installer.iss = ..\Installer.iss - ..\LICENSE = ..\LICENSE - ..\README.md = ..\README.md - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett.Console", "Jackett.Console\Jackett.Console.csproj", "{4E2A81DA-E235-4A88-AD20-38AABBFBF33C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett.Service", "Jackett.Service\Jackett.Service.csproj", "{BF611F7B-4658-4CB8-AA9E-0736FADAA3BA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett.Tray", "Jackett.Tray\Jackett.Tray.csproj", "{FF9025B1-EC14-4AA9-8081-9F69C5E35B63}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett.Test", "Jackett.Test\Jackett.Test.csproj", "{E75D4F15-5DA3-4332-ADB1-28FB673DAE56}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett.Distribution", "Jackett.Distribution\Jackett.Distribution.csproj", "{99D893EC-1A8A-42A9-AC6B-FE047AFC32F0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Website", "Website\Website.csproj", "{6B6AB1B0-5ABD-4696-A3D2-70E991174625}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Release|Any CPU.Build.0 = Release|Any CPU - {74420A79-CC16-442C-8B1E-7C1B913844F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {74420A79-CC16-442C-8B1E-7C1B913844F0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {74420A79-CC16-442C-8B1E-7C1B913844F0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {74420A79-CC16-442C-8B1E-7C1B913844F0}.Release|Any CPU.Build.0 = Release|Any CPU - {4E2A81DA-E235-4A88-AD20-38AABBFBF33C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4E2A81DA-E235-4A88-AD20-38AABBFBF33C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4E2A81DA-E235-4A88-AD20-38AABBFBF33C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4E2A81DA-E235-4A88-AD20-38AABBFBF33C}.Release|Any CPU.Build.0 = Release|Any CPU - {BF611F7B-4658-4CB8-AA9E-0736FADAA3BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF611F7B-4658-4CB8-AA9E-0736FADAA3BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF611F7B-4658-4CB8-AA9E-0736FADAA3BA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF611F7B-4658-4CB8-AA9E-0736FADAA3BA}.Release|Any CPU.Build.0 = Release|Any CPU - {FF9025B1-EC14-4AA9-8081-9F69C5E35B63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FF9025B1-EC14-4AA9-8081-9F69C5E35B63}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FF9025B1-EC14-4AA9-8081-9F69C5E35B63}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FF9025B1-EC14-4AA9-8081-9F69C5E35B63}.Release|Any CPU.Build.0 = Release|Any CPU - {E75D4F15-5DA3-4332-ADB1-28FB673DAE56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E75D4F15-5DA3-4332-ADB1-28FB673DAE56}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E75D4F15-5DA3-4332-ADB1-28FB673DAE56}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E75D4F15-5DA3-4332-ADB1-28FB673DAE56}.Release|Any CPU.Build.0 = Release|Any CPU - {99D893EC-1A8A-42A9-AC6B-FE047AFC32F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {99D893EC-1A8A-42A9-AC6B-FE047AFC32F0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {99D893EC-1A8A-42A9-AC6B-FE047AFC32F0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {99D893EC-1A8A-42A9-AC6B-FE047AFC32F0}.Release|Any CPU.Build.0 = Release|Any CPU - {6B6AB1B0-5ABD-4696-A3D2-70E991174625}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6B6AB1B0-5ABD-4696-A3D2-70E991174625}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6B6AB1B0-5ABD-4696-A3D2-70E991174625}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6B6AB1B0-5ABD-4696-A3D2-70E991174625}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(MonoDevelopProperties) = preSolution - Policies = $0 - $0.TextStylePolicy = $1 - $1.inheritsSet = VisualStudio - $1.inheritsScope = text/plain - $1.scope = text/x-csharp - $0.CSharpFormattingPolicy = $2 - $2.IndentSwitchBody = True - $2.IndentBlocksInsideExpressions = True - $2.AnonymousMethodBraceStyle = NextLine - $2.PropertyBraceStyle = NextLine - $2.PropertyGetBraceStyle = NextLine - $2.PropertySetBraceStyle = NextLine - $2.EventBraceStyle = NextLine - $2.EventAddBraceStyle = NextLine - $2.EventRemoveBraceStyle = NextLine - $2.StatementBraceStyle = NextLine - $2.ElseNewLinePlacement = NewLine - $2.CatchNewLinePlacement = NewLine - $2.FinallyNewLinePlacement = NewLine - $2.WhileNewLinePlacement = DoNotCare - $2.ArrayInitializerWrapping = DoNotChange - $2.ArrayInitializerBraceStyle = NextLine - $2.BeforeMethodDeclarationParentheses = False - $2.BeforeMethodCallParentheses = False - $2.BeforeConstructorDeclarationParentheses = False - $2.NewLineBeforeConstructorInitializerColon = NewLine - $2.NewLineAfterConstructorInitializerColon = SameLine - $2.BeforeDelegateDeclarationParentheses = False - $2.NewParentheses = False - $2.SpacesBeforeBrackets = False - $2.inheritsSet = Mono - $2.inheritsScope = text/x-csharp - $2.scope = text/x-csharp - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett", "Jackett\Jackett.csproj", "{E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CurlSharp", "CurlSharp\CurlSharp.csproj", "{74420A79-CC16-442C-8B1E-7C1B913844F0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BE7B0C8A-6144-47CD-821E-B09BA1B7BADE}" + ProjectSection(SolutionItems) = preProject + ..\Build.bat = ..\Build.bat + ..\Installer.iss = ..\Installer.iss + ..\LICENSE = ..\LICENSE + ..\README.md = ..\README.md + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett.Console", "Jackett.Console\Jackett.Console.csproj", "{4E2A81DA-E235-4A88-AD20-38AABBFBF33C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett.Service", "Jackett.Service\Jackett.Service.csproj", "{BF611F7B-4658-4CB8-AA9E-0736FADAA3BA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett.Tray", "Jackett.Tray\Jackett.Tray.csproj", "{FF9025B1-EC14-4AA9-8081-9F69C5E35B63}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett.Test", "Jackett.Test\Jackett.Test.csproj", "{E75D4F15-5DA3-4332-ADB1-28FB673DAE56}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett.Distribution", "Jackett.Distribution\Jackett.Distribution.csproj", "{99D893EC-1A8A-42A9-AC6B-FE047AFC32F0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Website", "Website\Website.csproj", "{6B6AB1B0-5ABD-4696-A3D2-70E991174625}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Distribution", "Distribution", "{DEAF0BB2-3F29-4805-9759-2BDF9FBD340B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jackett.Web", "Jackett.Web\Jackett.Web.csproj", "{7A9699EE-AA9B-4843-A0B4-D1FEC47B0FFC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E636D5F8-68B4-4903-B4ED-CCFD9C9E899F}.Release|Any CPU.Build.0 = Release|Any CPU + {74420A79-CC16-442C-8B1E-7C1B913844F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {74420A79-CC16-442C-8B1E-7C1B913844F0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {74420A79-CC16-442C-8B1E-7C1B913844F0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {74420A79-CC16-442C-8B1E-7C1B913844F0}.Release|Any CPU.Build.0 = Release|Any CPU + {4E2A81DA-E235-4A88-AD20-38AABBFBF33C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E2A81DA-E235-4A88-AD20-38AABBFBF33C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E2A81DA-E235-4A88-AD20-38AABBFBF33C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E2A81DA-E235-4A88-AD20-38AABBFBF33C}.Release|Any CPU.Build.0 = Release|Any CPU + {BF611F7B-4658-4CB8-AA9E-0736FADAA3BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BF611F7B-4658-4CB8-AA9E-0736FADAA3BA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BF611F7B-4658-4CB8-AA9E-0736FADAA3BA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BF611F7B-4658-4CB8-AA9E-0736FADAA3BA}.Release|Any CPU.Build.0 = Release|Any CPU + {FF9025B1-EC14-4AA9-8081-9F69C5E35B63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FF9025B1-EC14-4AA9-8081-9F69C5E35B63}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FF9025B1-EC14-4AA9-8081-9F69C5E35B63}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FF9025B1-EC14-4AA9-8081-9F69C5E35B63}.Release|Any CPU.Build.0 = Release|Any CPU + {E75D4F15-5DA3-4332-ADB1-28FB673DAE56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E75D4F15-5DA3-4332-ADB1-28FB673DAE56}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E75D4F15-5DA3-4332-ADB1-28FB673DAE56}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E75D4F15-5DA3-4332-ADB1-28FB673DAE56}.Release|Any CPU.Build.0 = Release|Any CPU + {99D893EC-1A8A-42A9-AC6B-FE047AFC32F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {99D893EC-1A8A-42A9-AC6B-FE047AFC32F0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {99D893EC-1A8A-42A9-AC6B-FE047AFC32F0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {99D893EC-1A8A-42A9-AC6B-FE047AFC32F0}.Release|Any CPU.Build.0 = Release|Any CPU + {6B6AB1B0-5ABD-4696-A3D2-70E991174625}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6B6AB1B0-5ABD-4696-A3D2-70E991174625}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6B6AB1B0-5ABD-4696-A3D2-70E991174625}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6B6AB1B0-5ABD-4696-A3D2-70E991174625}.Release|Any CPU.Build.0 = Release|Any CPU + {7A9699EE-AA9B-4843-A0B4-D1FEC47B0FFC}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {7A9699EE-AA9B-4843-A0B4-D1FEC47B0FFC}.Debug|Any CPU.Build.0 = Release|Any CPU + {7A9699EE-AA9B-4843-A0B4-D1FEC47B0FFC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A9699EE-AA9B-4843-A0B4-D1FEC47B0FFC}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {99D893EC-1A8A-42A9-AC6B-FE047AFC32F0} = {DEAF0BB2-3F29-4805-9759-2BDF9FBD340B} + {6B6AB1B0-5ABD-4696-A3D2-70E991174625} = {DEAF0BB2-3F29-4805-9759-2BDF9FBD340B} + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + Policies = $0 + $0.TextStylePolicy = $1 + $1.inheritsSet = VisualStudio + $1.inheritsScope = text/plain + $1.scope = text/x-csharp + $0.CSharpFormattingPolicy = $2 + $2.IndentSwitchBody = True + $2.IndentBlocksInsideExpressions = True + $2.AnonymousMethodBraceStyle = NextLine + $2.PropertyBraceStyle = NextLine + $2.PropertyGetBraceStyle = NextLine + $2.PropertySetBraceStyle = NextLine + $2.EventBraceStyle = NextLine + $2.EventAddBraceStyle = NextLine + $2.EventRemoveBraceStyle = NextLine + $2.StatementBraceStyle = NextLine + $2.ElseNewLinePlacement = NewLine + $2.CatchNewLinePlacement = NewLine + $2.FinallyNewLinePlacement = NewLine + $2.WhileNewLinePlacement = DoNotCare + $2.ArrayInitializerWrapping = DoNotChange + $2.ArrayInitializerBraceStyle = NextLine + $2.BeforeMethodDeclarationParentheses = False + $2.BeforeMethodCallParentheses = False + $2.BeforeConstructorDeclarationParentheses = False + $2.NewLineBeforeConstructorInitializerColon = NewLine + $2.NewLineAfterConstructorInitializerColon = SameLine + $2.BeforeDelegateDeclarationParentheses = False + $2.NewParentheses = False + $2.SpacesBeforeBrackets = False + $2.inheritsSet = Mono + $2.inheritsScope = text/x-csharp + $2.scope = text/x-csharp + EndGlobalSection +EndGlobal diff --git a/src/Jackett/App.config b/src/Jackett/App.config index 5415cbdd9..b620184bd 100644 --- a/src/Jackett/App.config +++ b/src/Jackett/App.config @@ -1,36 +1,52 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Jackett/CacheControlAttribute.cs b/src/Jackett/CacheControlAttribute.cs index 915d2f740..639508535 100644 --- a/src/Jackett/CacheControlAttribute.cs +++ b/src/Jackett/CacheControlAttribute.cs @@ -1,23 +1,26 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Web.Http.Filters; - -namespace Jackett -{ - public class JackettAPINoCacheAttribute : System.Web.Http.Filters.ActionFilterAttribute - { - public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) - { - actionExecutedContext.Response.Headers.CacheControl = new System.Net.Http.Headers.CacheControlHeaderValue() - { - NoStore = true, - Private = true - }; - - base.OnActionExecuted(actionExecutedContext); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web.Http.Filters; + +namespace Jackett +{ + public class JackettAPINoCacheAttribute : System.Web.Http.Filters.ActionFilterAttribute + { + public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) + { + if (actionExecutedContext.Response != null) + { + actionExecutedContext.Response.Headers.CacheControl = new System.Net.Http.Headers.CacheControlHeaderValue() + { + NoStore = true, + Private = true + }; + } + + base.OnActionExecuted(actionExecutedContext); + } + } +} diff --git a/src/Jackett/Content/logos/tehconnection.png b/src/Jackett/Content/logos/tehconnection.png new file mode 100644 index 000000000..4a859cec9 Binary files /dev/null and b/src/Jackett/Content/logos/tehconnection.png differ diff --git a/src/Jackett/Controllers/AutoDLController.cs b/src/Jackett/Controllers/AutoDLController.cs new file mode 100644 index 000000000..95ed60be0 --- /dev/null +++ b/src/Jackett/Controllers/AutoDLController.cs @@ -0,0 +1,47 @@ +using Jackett.Models.AutoDL; +using Jackett.Models.Irc; +using Jackett.Services; +using Jackett.Utils; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using System.Web.Http; + +namespace Jackett.Controllers +{ + [JackettAuthorized] + [JackettAPINoCache] + public class AutoDLController : ApiController + { + IAutoDLProfileService autodlService; + + public AutoDLController(IAutoDLProfileService a) + { + autodlService = a; + } + + [HttpGet] + [Route("AutoDL/Summary")] + public List Summary() + { + return autodlService.GetNetworks(); + } + + [HttpGet] + public List Index() + { + return autodlService.GetProfiles(); + } + + [HttpPut] + public IHttpActionResult Put([FromBody]AutoDLProfileSummary profile) + { + autodlService.Set(profile); + return Ok(); + } + } +} diff --git a/src/Jackett/Controllers/IRCCStateController.cs b/src/Jackett/Controllers/IRCCStateController.cs new file mode 100644 index 000000000..e7920ea5c --- /dev/null +++ b/src/Jackett/Controllers/IRCCStateController.cs @@ -0,0 +1,32 @@ +using Jackett.Models.AutoDL; +using Jackett.Models.DTO; +using Jackett.Services; +using Jackett.Utils; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web.Http; + +namespace Jackett.Controllers +{ + [JackettAuthorized] + [JackettAPINoCache] + public class IRCStateController : ApiController + { + private IIRCService irc; + + public IRCStateController(IIRCService i) + { + irc = i; + } + + [HttpGet] + public List Get() + { + return irc.GetSummary(); + } + + } +} diff --git a/src/Jackett/Controllers/IRCChannelController.cs b/src/Jackett/Controllers/IRCChannelController.cs new file mode 100644 index 000000000..90a1c2f3d --- /dev/null +++ b/src/Jackett/Controllers/IRCChannelController.cs @@ -0,0 +1,50 @@ +using Jackett.Models.DTO; +using Jackett.Models.Irc; +using Jackett.Services; +using Jackett.Utils; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web.Http; + +namespace Jackett.Controllers +{ + [JackettAuthorized] + [JackettAPINoCache] + public class IRCChannelController : ApiController + { + private IIRCService irc; + + public IRCChannelController(IIRCService i) + { + irc = i; + } + + [HttpGet] + public List Messages(string network) + { + return irc.GetMessages(network, null); + } + + [HttpGet] + public List Messages(string network, string room) + { + return irc.GetMessages(network, room); + } + + [HttpGet] + public List Users(string network, string room) + { + return irc.GetUser(network, room); + } + + [HttpPost] + public IHttpActionResult Command([FromBody]IRCommandDTO command) + { + irc.ProcessCommand(command.NetworkId, command.ChannelId, command.Text); + return Ok(); + } + } +} diff --git a/src/Jackett/Controllers/IRCProfileController.cs b/src/Jackett/Controllers/IRCProfileController.cs new file mode 100644 index 000000000..ccbe1e9c7 --- /dev/null +++ b/src/Jackett/Controllers/IRCProfileController.cs @@ -0,0 +1,55 @@ +using Jackett.Models.AutoDL; +using Jackett.Models.Irc; +using Jackett.Services; +using Jackett.Utils; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using System.Web.Http; + +namespace Jackett.Controllers +{ + [JackettAuthorized] + [JackettAPINoCache] + public class IRCProfileController : ApiController + { + IIRCProfileService profileService; + + public IRCProfileController(IIRCProfileService p) + { + profileService = p; + } + + [HttpGet] + public List Index() + { + return profileService.All; + } + + [HttpGet] + public IHttpActionResult Get(string id) + { + var item = profileService.Get(id); + if (item == null) + return NotFound(); + return Content(System.Net.HttpStatusCode.OK, item); + } + + public IHttpActionResult Put([FromBody]IRCProfile profile) + { + profileService.Set(profile); + return Ok(); + } + + + public IHttpActionResult Delete(string id) + { + profileService.Delete(id); + return Ok(); + } + } +} diff --git a/src/Jackett/ElementExtensions.cs b/src/Jackett/ElementExtensions.cs new file mode 100644 index 000000000..d0dd9d867 --- /dev/null +++ b/src/Jackett/ElementExtensions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Jackett +{ + public static class ElementExtensions + { + public static string AttributeString(this XElement element, string name) + { + var attr = element.Attribute(name); + if (attr == null) + return string.Empty; + return attr.Value; + } + + public static List AttributeStringList(this XElement element, string name) + { + var value = element.AttributeString(name); + return value.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).ToList(); + } + } + +} diff --git a/src/Jackett/Engine.cs b/src/Jackett/Engine.cs index 3b07f6098..795b3d4c0 100644 --- a/src/Jackett/Engine.cs +++ b/src/Jackett/Engine.cs @@ -1,154 +1,154 @@ -using Autofac; -using Jackett.Services; -using NLog; -using NLog.Config; -using NLog.LayoutRenderers; -using NLog.Targets; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Jackett -{ - public class Engine - { - private static IContainer container = null; - - static Engine() - { - BuildContainer(); - - } - - public static void BuildContainer() - { - var builder = new ContainerBuilder(); - builder.RegisterModule(); - container = builder.Build(); - - // Register the container in itself to allow for late resolves - var secondaryBuilder = new ContainerBuilder(); - secondaryBuilder.RegisterInstance(container).SingleInstance(); - SetupLogging(secondaryBuilder); - secondaryBuilder.Update(container); - - } - - public static IContainer GetContainer() - { - return container; - } - - public static bool IsWindows - { - get - { - return Environment.OSVersion.Platform == PlatformID.Win32NT; - } - } - - public static IConfigurationService ConfigService - { - get - { - return container.Resolve(); - } - } - - public static IProcessService ProcessService - { - get - { - return container.Resolve(); - } - } - - public static IServiceConfigService ServiceConfig - { - get - { - return container.Resolve(); - } - } - - public static IServerService Server - { - get - { - return container.Resolve(); - } - } - - public static IRunTimeService RunTime - { - get - { - return container.Resolve(); - } - } - - public static Logger Logger - { - get - { - return container.Resolve(); - } - } - - public static ISecuityService SecurityService - { - get - { - return container.Resolve(); - } - } - - - private static void SetupLogging(ContainerBuilder builder) - { - var logLevel = Startup.TracingEnabled ? LogLevel.Debug : LogLevel.Info; - // Add custom date time format renderer as the default is too long - ConfigurationItemFactory.Default.LayoutRenderers.RegisterDefinition("simpledatetime", typeof(SimpleDateTimeRenderer)); - - var logConfig = new LoggingConfiguration(); - var logFile = new FileTarget(); - logConfig.AddTarget("file", logFile); - logFile.Layout = "${longdate} ${level} ${message} ${exception:format=ToString}"; - logFile.FileName = Path.Combine(ConfigurationService.GetAppDataFolderStatic(), "log.txt"); - logFile.ArchiveFileName = "log.{#####}.txt"; - logFile.ArchiveAboveSize = 500000; - logFile.MaxArchiveFiles = 5; - logFile.KeepFileOpen = false; - logFile.ArchiveNumbering = ArchiveNumberingMode.DateAndSequence; - var logFileRule = new LoggingRule("*", logLevel, logFile); - logConfig.LoggingRules.Add(logFileRule); - - var logConsole = new ColoredConsoleTarget(); - logConfig.AddTarget("console", logConsole); - - logConsole.Layout = "${simpledatetime} ${level} ${message} ${exception:format=ToString}"; - var logConsoleRule = new LoggingRule("*", logLevel, logConsole); - logConfig.LoggingRules.Add(logConsoleRule); - - var logService = new LogCacheService(); - logConfig.AddTarget("service", logService); - var serviceRule = new LoggingRule("*", logLevel,logService); - logConfig.LoggingRules.Add(serviceRule); - - LogManager.Configuration = logConfig; - builder.RegisterInstance(LogManager.GetCurrentClassLogger()).SingleInstance(); - } - } - - [LayoutRenderer("simpledatetime")] - public class SimpleDateTimeRenderer : LayoutRenderer - { - protected override void Append(StringBuilder builder, LogEventInfo logEvent) - { - builder.Append(DateTime.Now.ToString("MM-dd HH:mm:ss")); - } - } -} +using Autofac; +using Jackett.Services; +using NLog; +using NLog.Config; +using NLog.LayoutRenderers; +using NLog.Targets; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett +{ + public class Engine + { + private static IContainer container = null; + + static Engine() + { + BuildContainer(); + + } + + public static void BuildContainer() + { + var builder = new ContainerBuilder(); + builder.RegisterModule(); + container = builder.Build(); + + // Register the container in itself to allow for late resolves + var secondaryBuilder = new ContainerBuilder(); + secondaryBuilder.RegisterInstance(container).SingleInstance(); + SetupLogging(secondaryBuilder); + secondaryBuilder.Update(container); + + } + + public static IContainer GetContainer() + { + return container; + } + + public static bool IsWindows + { + get + { + return Environment.OSVersion.Platform == PlatformID.Win32NT; + } + } + + public static IConfigurationService ConfigService + { + get + { + return container.Resolve(); + } + } + + public static IProcessService ProcessService + { + get + { + return container.Resolve(); + } + } + + public static IServiceConfigService ServiceConfig + { + get + { + return container.Resolve(); + } + } + + public static IServerService Server + { + get + { + return container.Resolve(); + } + } + + public static IRunTimeService RunTime + { + get + { + return container.Resolve(); + } + } + + public static Logger Logger + { + get + { + return container.Resolve(); + } + } + + public static ISecuityService SecurityService + { + get + { + return container.Resolve(); + } + } + + + private static void SetupLogging(ContainerBuilder builder) + { + var logLevel = Startup.TracingEnabled ? LogLevel.Trace : LogLevel.Info; + // Add custom date time format renderer as the default is too long + ConfigurationItemFactory.Default.LayoutRenderers.RegisterDefinition("simpledatetime", typeof(SimpleDateTimeRenderer)); + + var logConfig = new LoggingConfiguration(); + var logFile = new FileTarget(); + logConfig.AddTarget("file", logFile); + logFile.Layout = "${longdate} ${level} ${message} ${exception:format=ToString}"; + logFile.FileName = Path.Combine(ConfigurationService.GetAppDataFolderStatic(), "log.txt"); + logFile.ArchiveFileName = "log.{#####}.txt"; + logFile.ArchiveAboveSize = 500000; + logFile.MaxArchiveFiles = 5; + logFile.KeepFileOpen = false; + logFile.ArchiveNumbering = ArchiveNumberingMode.DateAndSequence; + var logFileRule = new LoggingRule("*", logLevel, logFile); + logConfig.LoggingRules.Add(logFileRule); + + var logConsole = new ColoredConsoleTarget(); + logConfig.AddTarget("console", logConsole); + + logConsole.Layout = "${simpledatetime} ${level} ${message} ${exception:format=ToString}"; + var logConsoleRule = new LoggingRule("*", logLevel, logConsole); + logConfig.LoggingRules.Add(logConsoleRule); + + var logService = new LogCacheService(); + logConfig.AddTarget("service", logService); + var serviceRule = new LoggingRule("*", logLevel,logService); + logConfig.LoggingRules.Add(serviceRule); + + LogManager.Configuration = logConfig; + builder.RegisterInstance(LogManager.GetCurrentClassLogger()).SingleInstance(); + } + } + + [LayoutRenderer("simpledatetime")] + public class SimpleDateTimeRenderer : LayoutRenderer + { + protected override void Append(StringBuilder builder, LogEventInfo logEvent) + { + builder.Append(DateTime.Now.ToString("MM-dd HH:mm:ss")); + } + } +} diff --git a/src/Jackett/Indexers/BaseIndexer.cs b/src/Jackett/Indexers/BaseIndexer.cs index 4ae334dca..404f55044 100644 --- a/src/Jackett/Indexers/BaseIndexer.cs +++ b/src/Jackett/Indexers/BaseIndexer.cs @@ -364,7 +364,7 @@ protected async Task RequestLoginAndFollowRedirect(string if (response.IsRedirect) { - await FollowIfRedirect(response, request.Url, null, response.Cookies); + await FollowIfRedirect(response, request.Url, redirectUrlOverride, response.Cookies); } if (returnCookiesFromFirstCall) diff --git a/src/Jackett/Indexers/TehConnection.cs b/src/Jackett/Indexers/TehConnection.cs new file mode 100644 index 000000000..1f9a45908 --- /dev/null +++ b/src/Jackett/Indexers/TehConnection.cs @@ -0,0 +1,184 @@ +using CsQuery; +using Jackett.Indexers; +using Jackett.Models; +using Jackett.Services; +using Jackett.Utils; +using Jackett.Utils.Clients; +using Newtonsoft.Json.Linq; +using NLog; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Threading.Tasks; +using System.Web; +using Jackett.Models.IndexerConfig; + +namespace Jackett.Indexers +{ + public class TehConnection : BaseIndexer, IIndexer + { + private string LoginUrl { get { return SiteLink + "login.php"; } } + private string indexUrl { get { return SiteLink + "index.php"; } } + private string SearchUrl { get { return SiteLink + "torrents.php"; } } + + new ConfigurationDataBasicLoginWithFilter configData + { + get { return (ConfigurationDataBasicLoginWithFilter)base.configData; } + set { base.configData = value; } + } + + public TehConnection(IIndexerManagerService i, Logger l, IWebClient c, IProtectionService ps) + : base(name: "TehConnection", + description: "Working towards providing a well-seeded archive of all available digital forms of cinema and film in their highest possible quality", + link: "https://tehconnection.eu/", + caps: new TorznabCapabilities(), + manager: i, + client: c, + logger: l, + p: ps, + configData: new ConfigurationDataBasicLoginWithFilter(@"Enter filter options below to restrict search results. + Separate options with a space if using more than one option.
Filter options available: +
QualityEncodeOnly
FreeLeechOnly")) + { + AddCategoryMapping(7, TorznabCatType.Movies); + AddCategoryMapping(7, TorznabCatType.MoviesForeign); + AddCategoryMapping(7, TorznabCatType.MoviesOther); + AddCategoryMapping(7, TorznabCatType.MoviesSD); + AddCategoryMapping(7, TorznabCatType.MoviesHD); + AddCategoryMapping(7, TorznabCatType.Movies3D); + AddCategoryMapping(7, TorznabCatType.MoviesBluRay); + AddCategoryMapping(7, TorznabCatType.MoviesDVD); + AddCategoryMapping(7, TorznabCatType.MoviesWEBDL); + } + + public async Task ApplyConfiguration(JToken configJson) + { + configData.LoadValuesFromJson(configJson); + var pairs = new Dictionary { + { "username", configData.Username.Value }, + { "password", configData.Password.Value }, + { "keeplogged", "1" }, + { "login", "Log In!" } + }; + + var response = await RequestLoginAndFollowRedirect(LoginUrl, pairs, null, true, indexUrl, SiteLink); + + await ConfigureIfOK(response.Cookies, response.Content != null && response.Content.Contains("/logout.php"), () => + { + CQ dom = response.Content; + string errorMessage = "Unable to login to TehConnection"; + throw new ExceptionWithConfigData(errorMessage, configData); + }); + return IndexerConfigurationStatus.RequiresTesting; + } + + public async Task> PerformQuery(TorznabQuery query) + { + var releases = new List(); + bool configFreeLeechOnly = configData.FilterString.Value.ToLowerInvariant().Contains("freeleechonly"); + bool configQualityEncodeOnly = configData.FilterString.Value.ToLowerInvariant().Contains("qualityencodeonly"); + string movieListSearchUrl; + + if (string.IsNullOrEmpty(query.GetQueryString())) + movieListSearchUrl = SearchUrl; + else + { + movieListSearchUrl = string.Format("{0}?action=basic&searchstr={1}", SearchUrl, HttpUtility.UrlEncode(query.GetQueryString())); + } + + var results = await RequestStringWithCookiesAndRetry(movieListSearchUrl); + try + { + CQ mdom = results.Content; + + var mrows = mdom[".torrent_title_box"]; + foreach (var mrow in mrows.Take(5)) + { + var mqRow = mrow.Cq(); + + Uri movieReleasesLink = new Uri(SiteLink.TrimEnd('/') + mqRow.Find("a[title='View Torrent']").First().Attr("href").Trim()); + Uri commentsLink = new Uri(movieReleasesLink + "#comments"); + + string imdblink = mqRow.Find("span[class='imdb-number-rating']").Length > 0 ? mqRow.Find("span[class='imdb-number-rating'] > a").First().Attr("href").Trim() : ""; + long imdb_id = 0; + try + { + if (!string.IsNullOrWhiteSpace(imdblink) && imdblink.ToLowerInvariant().Contains("tt")) + { + imdb_id = long.Parse(imdblink.Substring(imdblink.LastIndexOf('t') + 1).Replace("/", "")); + } + } + catch { imdb_id = 0; } + + var release_results = await RequestStringWithCookiesAndRetry(movieReleasesLink.ToString()); + + //Iterate over the releases for each movie + + CQ dom = release_results.Content; + + var rows = dom[".torrent_widget.box.pad"]; + foreach (var row in rows) + { + var qRow = row.Cq(); + + string title = qRow.Find("[id^=desc_] > h2 > strong").First().Text().Trim(); + Uri link = new Uri(SiteLink.TrimEnd('/') + qRow.Find("a[title='Download']").First().Attr("href").Trim()); + Uri guid = new Uri(SiteLink.TrimEnd('/') + qRow.Find("a[title='Permalink']").First().Attr("href").Trim()); + string pubDateStr = qRow.Find("div[class='box pad'] > p:contains('Uploaded by') > span").First().Attr("title").Trim(); + DateTime pubDate = DateTime.ParseExact(pubDateStr, "MMM dd yyyy, HH:mm", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal).ToLocalTime(); + string sizeStr = qRow.Find("[id^=desc_] > div > table > tbody > tr > td > strong:contains('Size:')").First().Parent().Parent().Find("td").Last().Text().Trim(); + var seeders = ParseUtil.CoerceInt(qRow.Find("img[title='Seeders']").First().Parent().Text().Trim()); + var peers = ParseUtil.CoerceInt(qRow.Find("img[title='Leechers']").First().Parent().Text().Trim()) + seeders; + Uri CoverUrl = new Uri(SiteLink.TrimEnd('/') + dom.Find("div[id='poster'] > a > img").First().Attr("src").Trim()); + bool freeleech = qRow.Find("span[class='freeleech']").Length == 1 ? true : false; + bool qualityEncode = qRow.Find("img[class='approved']").Length == 1 ? true : false; + string grabs = qRow.Find("img[title='Snatches']").First().Parent().Text().Trim(); + if (string.IsNullOrWhiteSpace(sizeStr)) + { + string secondSizeStr = qRow.Find("div[class='details_title'] > strong:contains('(')").Last().Text().Trim(); + if (secondSizeStr.Length > 3 && secondSizeStr.Contains("(") && secondSizeStr.Contains(")")) + { sizeStr = secondSizeStr.Replace("(", "").Replace(")", "").Trim(); } + } + + var release = new ReleaseInfo(); + + release.Title = title; + release.Guid = guid; + release.Link = link; + release.PublishDate = pubDate; + release.Size = ReleaseInfo.GetBytes(sizeStr); + release.Description = release.Title; + release.Seeders = seeders; + release.Peers = peers; + release.MinimumRatio = 1; + release.MinimumSeedTime = 345600; + release.Category = 2000; + release.Comments = commentsLink; + if (imdb_id > 0) { + release.Imdb = imdb_id; + } + + if (configFreeLeechOnly && !freeleech) + { + continue; //Skip release if user only wants FreeLeech + } + if (configQualityEncodeOnly && !qualityEncode) + { + continue; //Skip release if user only wants Quality Encode + } + + releases.Add(release); + } + + } + } + catch (Exception ex) + { + OnParseError(results.Content, ex); + } + + return releases; + } + } +} diff --git a/src/Jackett/Jackett.csproj b/src/Jackett/Jackett.csproj index 2f128f417..d1c368f45 100644 --- a/src/Jackett/Jackett.csproj +++ b/src/Jackett/Jackett.csproj @@ -62,10 +62,18 @@ ..\packages\Autofac.3.5.2\lib\net40\Autofac.dll True
+ + ..\packages\Autofac.Extras.CommonServiceLocator.3.2.0\lib\net40\Autofac.Extras.CommonServiceLocator.dll + True + ..\packages\Autofac.Owin.3.1.0\lib\net45\Autofac.Integration.Owin.dll True + + ..\packages\Autofac.SignalR2.3.1.0\lib\net45\Autofac.Integration.SignalR.dll + True + ..\packages\Autofac.WebApi2.3.4.0\lib\net45\Autofac.Integration.WebApi.dll True @@ -82,10 +90,42 @@ ..\packages\CsQuery.1.3.4\lib\net40\CsQuery.dll True + + ..\packages\CuttingEdge.Conditions.1.2.0.0\lib\NET35\CuttingEdge.Conditions.dll + True + + + ..\packages\IrcDotNet.0.5.0\lib\net45\IrcDotNet.dll + True + + + ..\packages\Magnum.2.1.3\lib\NET40\Magnum.dll + True + + + ..\packages\MediatR.2.0.2\lib\net45\MediatR.dll + True + + + ..\packages\MediatR.Extensions.0.6.0.0\lib\net45\MediatR.Extensions.dll + True + + + ..\packages\MediatR.Extensions.Autofac.0.6.0.0\lib\net45\MediatR.Extensions.Autofac.dll + True + ..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll True + + ..\packages\Microsoft.AspNet.SignalR.Core.2.2.0\lib\net45\Microsoft.AspNet.SignalR.Core.dll + True + + + ..\packages\Microsoft.AspNet.SignalR.Owin.1.2.2\lib\net45\Microsoft.AspNet.SignalR.Owin.dll + True + ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll True @@ -106,16 +146,28 @@ ..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll True + + ..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll + True + ..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll True + + ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll + True + + + ..\packages\MoreLinq.Portable.1.1.0\lib\portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\MoreLinq.Portable.dll + True + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll True - - ..\packages\NLog.4.0.1\lib\net45\NLog.dll + + ..\packages\NLog.4.1.0\lib\net45\NLog.dll True @@ -126,6 +178,10 @@ ..\packages\Owin.1.0\lib\net40\Owin.dll True + + ..\packages\Swashbuckle.Core.Net45.5.2.1\lib\net45\Swashbuckle.Core.dll + True + @@ -147,10 +203,18 @@ + + ..\packages\Microsoft.AspNet.Cors.5.2.3\lib\net45\System.Web.Cors.dll + True + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll True + + ..\packages\Microsoft.AspNet.WebApi.Cors.5.2.3\lib\net45\System.Web.Http.Cors.dll + True + ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll True @@ -170,9 +234,14 @@ + + + + + @@ -186,6 +255,7 @@ + @@ -196,6 +266,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -249,9 +365,17 @@ + + + + + + + + @@ -491,6 +615,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/src/Jackett/JackettModule.cs b/src/Jackett/JackettModule.cs index 988b61238..42d6db50a 100644 --- a/src/Jackett/JackettModule.cs +++ b/src/Jackett/JackettModule.cs @@ -10,6 +10,11 @@ using Jackett.Utils.Clients; using AutoMapper; using Jackett.Models; +using Autofac.Integration.SignalR; +using Jackett.Services; +using Autofac.Features.Variance; +using MediatR; +using Jackett.Services.SignalR; namespace Jackett { @@ -22,6 +27,7 @@ protected override void Load(ContainerBuilder builder) builder.RegisterAssemblyTypes(thisAssembly).Except().AsImplementedInterfaces().SingleInstance(); builder.RegisterApiControllers(thisAssembly).InstancePerRequest(); builder.RegisterType(); + builder.RegisterType(); // Register the best web client for the platform or the override switch (Startup.ClientOverride) @@ -77,6 +83,22 @@ protected override void Load(ContainerBuilder builder) { t.CategoryDesc = TorznabCatType.GetCatDesc(r.Category); }); + + builder.RegisterSource(new ContravariantRegistrationSource()); + builder.RegisterAssemblyTypes(typeof(IMediator).Assembly).AsImplementedInterfaces(); + + builder.Register(ctx => + { + var c = ctx.Resolve(); + return t => c.Resolve(t); + }); + builder.Register(ctx => + { + var c = ctx.Resolve(); + return t => (IEnumerable)c.Resolve(typeof(IEnumerable<>).MakeGenericType(t)); + }); + + } } } diff --git a/src/Jackett/Models/AutoDL/AutoDLProfileConfig.cs b/src/Jackett/Models/AutoDL/AutoDLProfileConfig.cs new file mode 100644 index 000000000..8bf608dab --- /dev/null +++ b/src/Jackett/Models/AutoDL/AutoDLProfileConfig.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.AutoDL +{ + public class AutoDLProfileConfig + { + public string Type { get; set; } + public Dictionary Options { set; get; } = new Dictionary(); + } +} diff --git a/src/Jackett/Models/AutoDL/AutoDLProfileSummary.cs b/src/Jackett/Models/AutoDL/AutoDLProfileSummary.cs new file mode 100644 index 000000000..820cda1fe --- /dev/null +++ b/src/Jackett/Models/AutoDL/AutoDLProfileSummary.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.AutoDL +{ + public class AutoDLProfileSummary + { + public string Type { get; set; } + public string ShortName { get; set; } + public string LongName { get; set; } + public string SiteName { get; set; } + public bool IsConfigured { set; get; } + public List Options { get; set; } = new List(); + } +} diff --git a/src/Jackett/Models/AutoDL/ConfigOption.cs b/src/Jackett/Models/AutoDL/ConfigOption.cs new file mode 100644 index 000000000..c2f9008d0 --- /dev/null +++ b/src/Jackett/Models/AutoDL/ConfigOption.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.AutoDL +{ + public class ConfigOption + { + public string Name { get; set; } + public string Label { set; get; } + public ConfigOptionType? Type { get; set; } + public string Value { get; set; } + public string DefaultValue { get; set; } + public string EmptyText { get; set; } + public string Tooltip { get; set; } + public string PasteGroup { get; set; } + public string PasteRegex { get; set; } + public string MinValue { get; set; } + public string MaxValue { get; set; } + public bool IsDownloadVar { set; get; } + } + + public enum ConfigOptionType { TextBox, Integer, Bool, Delta, Description } +} diff --git a/src/Jackett/Models/AutoDL/NetworkSummary.cs b/src/Jackett/Models/AutoDL/NetworkSummary.cs new file mode 100644 index 000000000..c1a70b138 --- /dev/null +++ b/src/Jackett/Models/AutoDL/NetworkSummary.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.AutoDL +{ + public class NetworkSummary + { + public string Name { get; set; } + public List Servers { get; set; } = new List(); + public List Profiles { get; set; } = new List(); + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/BaseParserCommand.cs b/src/Jackett/Models/AutoDL/Parser/BaseParserCommand.cs new file mode 100644 index 000000000..7524f4606 --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/BaseParserCommand.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.AutoDL.Parser +{ + public abstract class BaseParserCommand + { + public List Children { get; set; } = new List(); + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/Extract.cs b/src/Jackett/Models/AutoDL/Parser/Extract.cs new file mode 100644 index 000000000..72a6cee79 --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/Extract.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Jackett.Models.AutoDL.Parser +{ + public class Extract : BaseParserCommand, IParserCommand + { + public bool Execute(ParserState state) + { + foreach (var action in base.Children) + { + if (!action.Execute(state)) + return false; + } + + return true; + } + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/ExtractOne.cs b/src/Jackett/Models/AutoDL/Parser/ExtractOne.cs new file mode 100644 index 000000000..ba89d3657 --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/ExtractOne.cs @@ -0,0 +1,29 @@ +using CuttingEdge.Conditions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web; +using System.Xml.Linq; + +namespace Jackett.Models.AutoDL.Parser +{ + public class ExtractOne : BaseParserCommand, IParserCommand + { + public ExtractOne(XElement x) + { + } + + public bool Execute(ParserState state) + { + state.Logger.Debug($"{state.Tracker} ExtractOne has {base.Children.Count} child actions."); + foreach(var item in base.Children) + { + if(item.Execute(state)) + return true; + } + return true; + } + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/ExtractTags.cs b/src/Jackett/Models/AutoDL/Parser/ExtractTags.cs new file mode 100644 index 000000000..df81594b5 --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/ExtractTags.cs @@ -0,0 +1,49 @@ +using CuttingEdge.Conditions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Jackett.Models.AutoDL.Parser +{ + public class ExtractTags : BaseParserCommand, IParserCommand + { + string src; + string splitItem; + + public ExtractTags(XElement x) + { + src = x.AttributeString("srcvar"); + Condition.Requires(src).IsNotNullOrWhiteSpace(); + splitItem = x.AttributeString("split"); + Condition.Requires(splitItem).IsNotNullOrEmpty(); + } + + public bool Execute(ParserState state) + { + var srcValue = state.Variables[src]; + if (srcValue == null) + { + state.Logger.Debug($"{state.Tracker} ExtractTags failed processing null {srcValue}."); + return true; + } + + var split = srcValue.Split(splitItem.ToCharArray()); + state.Logger.Debug($"{state.Tracker} ExtractTags split to {split.Length}."); + for(int i = 0; i < split.Length; i++) + { + if (i <= base.Children.Count) + { + state.CurrentValue = split[i]; + if (!base.Children[i].Execute(state)) + return false; + } + } + + state.Logger.Debug($"{state.Tracker} VarEnc returning {state.CurrentValue}."); + return true; + } + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/Http.cs b/src/Jackett/Models/AutoDL/Parser/Http.cs new file mode 100644 index 000000000..a8e08408d --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/Http.cs @@ -0,0 +1,47 @@ +using CuttingEdge.Conditions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Jackett.Models.AutoDL.Parser +{ + public class Http : BaseParserCommand, IParserCommand + { + string name; + + public Http(XElement x) + { + name = x.AttributeString("name"); + Condition.Requires(name).IsNotNullOrWhiteSpace(); + } + + public bool Execute(ParserState state) + { + var builder = new StringBuilder(); + + for (var i = 0; i < base.Children.Count; i++) + { + var action = base.Children[i]; + var subState = state.Clone(); + subState.CurrentItem = string.Empty; + if (!action.Execute(subState)) + { + state.Logger.Debug($"{state.Tracker} Http sub {i} action failed."); + return false; + } + else + { + builder.Append(state.CurrentItem); + } + } + + var value = builder.ToString(); + state.Logger.Debug($"{state.Tracker} Http setting {name} to {value}."); + state.HTTPHeaders[name] = value; + return true; + } + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/IParserCommand.cs b/src/Jackett/Models/AutoDL/Parser/IParserCommand.cs new file mode 100644 index 000000000..1ee9efdd8 --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/IParserCommand.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.AutoDL.Parser +{ + public interface IParserCommand + { + bool Execute(ParserState state); + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/If.cs b/src/Jackett/Models/AutoDL/Parser/If.cs new file mode 100644 index 000000000..c7e92697c --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/If.cs @@ -0,0 +1,45 @@ +using CuttingEdge.Conditions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web; +using System.Xml.Linq; + +namespace Jackett.Models.AutoDL.Parser +{ + public class If : BaseParserCommand, IParserCommand + { + string srcVar; + System.Text.RegularExpressions.Regex regex; + + + public If(XElement x) + { + srcVar = x.AttributeString("srcvar"); + var regexStr = x.AttributeString("regex"); + Condition.Requires(srcVar).IsNotNullOrWhiteSpace(); + Condition.Requires(regexStr).IsNotNullOrWhiteSpace(); + regex = new System.Text.RegularExpressions.Regex(regexStr); + } + + public bool Execute(ParserState state) + { + if (regex.Match(state.Variables[srcVar]).Success) + { + foreach(var subAction in this.Children) + { + if (!subAction.Execute(state)) + return false; + } + + return true; + } + else + { + return true; + } + } + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/Ignore.cs b/src/Jackett/Models/AutoDL/Parser/Ignore.cs new file mode 100644 index 000000000..16eec8abd --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/Ignore.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Jackett.Models.AutoDL.Parser +{ + public class Ignore : BaseParserCommand, IParserCommand + { + public bool Execute(ParserState state) + { + foreach(var action in base.Children) + { + if (action.Execute(state)) + return false; + } + + return true; + } + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/LineMatched.cs b/src/Jackett/Models/AutoDL/Parser/LineMatched.cs new file mode 100644 index 000000000..dd8d707e7 --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/LineMatched.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.AutoDL.Parser +{ + public class LineMatched : BaseParserCommand, IParserCommand + { + public bool Execute(ParserState state) + { + foreach (var action in base.Children) + { + if (!action.Execute(state)) + return false; + } + + return true; + } + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/LinePatterns.cs b/src/Jackett/Models/AutoDL/Parser/LinePatterns.cs new file mode 100644 index 000000000..dfbd6e0a3 --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/LinePatterns.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.AutoDL.Parser +{ + public class LinePatterns : BaseParserCommand + { + public List Execute(ParserState state) + { + var matchedStates = new List(); + foreach(var action in base.Children) + { + var extract = action as Extract; + if (extract != null) + { + var subState = state.Clone(); + if (extract.Execute(subState)) + { + matchedStates.Add(subState); + } + } + } + + return matchedStates; + } + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/ParseInfo.cs b/src/Jackett/Models/AutoDL/Parser/ParseInfo.cs new file mode 100644 index 000000000..c0d26631f --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/ParseInfo.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.AutoDL.Parser +{ + public class ParseInfo + { + public List SingleLineMatches { get; set; } = new List(); + public List MatchParsers { get; set; } = new List(); + public List IgnoreMatches { get; set; } = new List(); + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/ParserState.cs b/src/Jackett/Models/AutoDL/Parser/ParserState.cs new file mode 100644 index 000000000..335ee5d62 --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/ParserState.cs @@ -0,0 +1,32 @@ +using AutoMapper; +using NLog; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.AutoDL.Parser +{ + public class ParserState + { + public Dictionary Variables { get; set; } = new Dictionary(); + public Dictionary HTTPHeaders { get; set; } = new Dictionary(); + public List TempVariables { get; set; } = new List(); + public Logger Logger { get; set; } + public string Tracker { get; set; } + + public string CurrentItem { get; set; } + public string CurrentValue { get; set; } + + static ParserState() + { + Mapper.CreateMap(); + } + + public ParserState Clone() + { + return Mapper.Map(this); + } + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/Regex.cs b/src/Jackett/Models/AutoDL/Parser/Regex.cs new file mode 100644 index 000000000..c88ef0886 --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/Regex.cs @@ -0,0 +1,46 @@ +using CuttingEdge.Conditions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Jackett.Models.AutoDL.Parser +{ + public class Regex : IParserCommand + { + System.Text.RegularExpressions.Regex regex; + + public Regex(XElement x) + { + var value = x.AttributeString("value"); + Condition.Requires(value).IsNotNull(); + regex = new System.Text.RegularExpressions.Regex(value); + } + + public bool Execute(ParserState state) + { + var matches = regex.Matches(state.CurrentItem); + + state.Logger.Debug($"{state.Tracker} Regex matches: {matches.Count}"); + if (matches.Count == 0) + { + return false; + } + + state.TempVariables = new List(); + + foreach(var match in matches.Cast().Where(m => m.Success)) + { + foreach(var group in match.Groups.Cast().Skip(1)) + { + state.TempVariables.Add(group.Value); + } + } + + return true; + } + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/SetRegex.cs b/src/Jackett/Models/AutoDL/Parser/SetRegex.cs new file mode 100644 index 000000000..0591215ed --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/SetRegex.cs @@ -0,0 +1,44 @@ +using CuttingEdge.Conditions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Jackett.Models.AutoDL.Parser +{ + public class SetRegex : BaseParserCommand, IParserCommand + { + string srcvar; + string varname; + string newvalue; + System.Text.RegularExpressions.Regex regex; + + public SetRegex(XElement x) + { + srcvar = x.AttributeString("srcvar"); + regex = new System.Text.RegularExpressions.Regex(x.AttributeString("regex")); + varname = x.AttributeString("varName"); + newvalue = x.AttributeString("newValue"); + Condition.Requires(srcvar).IsNotNullOrWhiteSpace(); + Condition.Requires(regex).IsNotNull(); + Condition.Requires(varname).IsNotNullOrWhiteSpace(); + Condition.Requires(newvalue).IsNotNull(); + } + + public bool Execute(ParserState state) + { + var item = state.Variables[srcvar]; + if (item == null) + { + state.Logger.Debug($"{state.Tracker} SetRegex failed setting null var: {srcvar}"); + return false; + } else + { + state.Variables[srcvar] = regex.Replace(state.Variables[srcvar], newvalue); + return true; + } + } + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/SetVarIf.cs b/src/Jackett/Models/AutoDL/Parser/SetVarIf.cs new file mode 100644 index 000000000..05ff2fe49 --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/SetVarIf.cs @@ -0,0 +1,62 @@ +using CuttingEdge.Conditions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web; +using System.Xml.Linq; + +namespace Jackett.Models.AutoDL.Parser +{ + public class SetVarIf :IParserCommand + { + string varname; + string value; + System.Text.RegularExpressions.Regex regex; + string newValue; + + + public SetVarIf(XElement x) + { + varname = x.AttributeString("varName"); + Condition.Requires(varname).IsNotNullOrWhiteSpace(); + + var regexStr = x.AttributeString("regex"); + + if (regexStr != null) + { + regex = new System.Text.RegularExpressions.Regex(regexStr); + } + else + { + value = x.AttributeString("value"); + newValue = x.AttributeString("newValue"); + } + } + + public bool Execute(ParserState state) + { + if (regex == null) + { + var ok = string.Equals(state.Variables[varname], value, StringComparison.InvariantCultureIgnoreCase); + if (ok) + { + state.Variables[varname] = newValue; + } + + state.Logger.Debug($"{state.Tracker} SetVarIf eq ok {ok} var {varname} = {newValue}."); + } + else + { + var match = regex.Match(state.Variables[varname]); + if (match.Success) + state.Variables[varname] = match.Groups[0].Value; + + state.Logger.Debug($"{state.Tracker} SetVarIf regex ok {match.Success} var {varname} = {match.Value}."); + } + + return true; + } + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/String.cs b/src/Jackett/Models/AutoDL/Parser/String.cs new file mode 100644 index 000000000..4c82b1f14 --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/String.cs @@ -0,0 +1,39 @@ +using CuttingEdge.Conditions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Web; +using System.Xml.Linq; + +namespace Jackett.Models.AutoDL.Parser +{ + class String : BaseParserCommand, IParserCommand + { + string name; + string value; + + public String(XElement x) + { + name = x.AttributeString("name"); + value = x.AttributeString("value"); + //Condition.Requires(name).IsNotNullOrWhiteSpace(); + } + + public bool Execute(ParserState state) + { + if (string.IsNullOrEmpty(name)) + { + state.CurrentValue = value; + state.Logger.Debug($"{state.Tracker} String returning value {value}."); + } + else + { + state.CurrentValue = state.Variables[name]; + state.Logger.Debug($"{state.Tracker} String returning {state.CurrentValue}."); + } + return true; + } + } +} diff --git a/src/Jackett/Models/AutoDL/Parser/Var.cs b/src/Jackett/Models/AutoDL/Parser/Var.cs new file mode 100644 index 000000000..624bdcf53 --- /dev/null +++ b/src/Jackett/Models/AutoDL/Parser/Var.cs @@ -0,0 +1,65 @@ +using CuttingEdge.Conditions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Jackett.Models.AutoDL.Parser +{ + public class Var : BaseParserCommand, IParserCommand + { + string name; + + public Var(XElement x) + { + name = x.AttributeString("name"); + Condition.Requires(name).IsNotNullOrWhiteSpace(); + } + + public bool Execute(ParserState state) + { + if (state.TempVariables.Count == 0) + { + // Write variable + state.CurrentValue = state.Variables[name]; + state.Logger.Debug($"{state.Tracker} Var returning {state.Variables[name]} from {name}."); + + return true; + } + else if (base.Children.Count > 0) + { + // Build value from other actions + var builder = new StringBuilder(); + + for(var i=0;i= base.Children.Count) + { + state.Logger.Debug($"{state.Tracker} Vars more variables than children!"); + } + else + { + var originalItem = state.CurrentItem; + state.CurrentValue = state.TempVariables[i]; + base.Children[i].Execute(state); + } + } + + return true; + } + } +} diff --git a/src/Jackett/Models/AutoDL/SavedAutoDLConfig.cs b/src/Jackett/Models/AutoDL/SavedAutoDLConfig.cs new file mode 100644 index 000000000..2fa9c933f --- /dev/null +++ b/src/Jackett/Models/AutoDL/SavedAutoDLConfig.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.AutoDL +{ + public class SavedAutoDLConfig + { + public string Type { set; get; } + public Dictionary Options { get; set; } = new Dictionary(); + } +} diff --git a/src/Jackett/Models/AutoDL/SavedAutoDLConfigurations.cs b/src/Jackett/Models/AutoDL/SavedAutoDLConfigurations.cs new file mode 100644 index 000000000..189d8a0a8 --- /dev/null +++ b/src/Jackett/Models/AutoDL/SavedAutoDLConfigurations.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.AutoDL +{ + public class SavedAutoDLConfigurations + { + public List Configurations { set; get; } = new List(); + } +} diff --git a/src/Jackett/Models/AutoDL/ServerInfo.cs b/src/Jackett/Models/AutoDL/ServerInfo.cs new file mode 100644 index 000000000..8407eb227 --- /dev/null +++ b/src/Jackett/Models/AutoDL/ServerInfo.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.AutoDL +{ + public class ServerInfo + { + public string Network { get; set; } + public List Servers { get; set; } = new List(); + public List Channels { get; set; } = new List(); + public List Announcers { get; set; } = new List(); + } +} diff --git a/src/Jackett/Models/AutoDL/TrackerInfo.cs b/src/Jackett/Models/AutoDL/TrackerInfo.cs new file mode 100644 index 000000000..e34bb8d4f --- /dev/null +++ b/src/Jackett/Models/AutoDL/TrackerInfo.cs @@ -0,0 +1,28 @@ +using Jackett.Models.AutoDL.Parser; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.AutoDL +{ + public class TrackerInfo + { + public bool IsConfigured { get; set; } + + public string FileName { get; set; } + public string Type { get; set; } + public string ShortName { get; set; } + public string LongName { get; set; } + public string SiteName { get; set; } + // Defined but never used + // public bool Deobfuscate { get; set; } + // public string Follow302 { get; set; } + public List Servers { get; set; } = new List(); + + public List Options { get; set; } = new List(); + + public ParseInfo Parser { get; set; } = new ParseInfo(); + } +} diff --git a/src/Jackett/Models/Commands/IRC/AddProfileEvent.cs b/src/Jackett/Models/Commands/IRC/AddProfileEvent.cs new file mode 100644 index 000000000..ebaa6e025 --- /dev/null +++ b/src/Jackett/Models/Commands/IRC/AddProfileEvent.cs @@ -0,0 +1,15 @@ +using Jackett.Models.Irc; +using MediatR; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.Commands.IRC +{ + public class AddProfileEvent : INotification + { + public IRCProfile Profile { get; set; } + } +} diff --git a/src/Jackett/Models/Commands/IRC/IRCMessageEvent.cs b/src/Jackett/Models/Commands/IRC/IRCMessageEvent.cs new file mode 100644 index 000000000..c67d5424d --- /dev/null +++ b/src/Jackett/Models/Commands/IRC/IRCMessageEvent.cs @@ -0,0 +1,18 @@ +using MediatR; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.Commands.IRC +{ + public class IRCMessageEvent : INotification + { + public string Network { get; set; } + public string Channel { get; set;} + public string Profile { get; set; } + public string Message { get; set; } + public string From { get; set; } + } +} diff --git a/src/Jackett/Models/Commands/IRC/IRCStateChangedEvent.cs b/src/Jackett/Models/Commands/IRC/IRCStateChangedEvent.cs new file mode 100644 index 000000000..f3d0e6f2b --- /dev/null +++ b/src/Jackett/Models/Commands/IRC/IRCStateChangedEvent.cs @@ -0,0 +1,13 @@ +using MediatR; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.Commands.IRC +{ + public class IRCStateChangedEvent : INotification + { + } +} diff --git a/src/Jackett/Models/Commands/IRC/IRCUsersChangedEvent.cs b/src/Jackett/Models/Commands/IRC/IRCUsersChangedEvent.cs new file mode 100644 index 000000000..43d1756b3 --- /dev/null +++ b/src/Jackett/Models/Commands/IRC/IRCUsersChangedEvent.cs @@ -0,0 +1,14 @@ +using MediatR; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.Commands.IRC +{ + public class IRCUsersChangedEvent : INotification + { + public string Id { get; set; } + } +} diff --git a/src/Jackett/Models/DTO/ChannelDTO.cs b/src/Jackett/Models/DTO/ChannelDTO.cs new file mode 100644 index 000000000..37fc022ea --- /dev/null +++ b/src/Jackett/Models/DTO/ChannelDTO.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.DTO +{ + public class ChannelDTO + { + public string Name { get; set; } + public string Id { get; set; } + } +} diff --git a/src/Jackett/Models/DTO/IRCommandDTO.cs b/src/Jackett/Models/DTO/IRCommandDTO.cs new file mode 100644 index 000000000..a466df973 --- /dev/null +++ b/src/Jackett/Models/DTO/IRCommandDTO.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.DTO +{ + public class IRCommandDTO + { + public string Text { get; set; } + public string NetworkId { get; set; } + public string ChannelId { get; set; } + } +} diff --git a/src/Jackett/Models/DTO/NetworkDTO.cs b/src/Jackett/Models/DTO/NetworkDTO.cs new file mode 100644 index 000000000..47fab9cd6 --- /dev/null +++ b/src/Jackett/Models/DTO/NetworkDTO.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.DTO +{ + public class NetworkDTO + { + public string Name { get; set; } + public string Id { get; set; } + public List Channels { get; set; } = new List(); + } +} diff --git a/src/Jackett/Models/IndexerConfig/ConfigurationDataBasicLoginWithFilter.cs b/src/Jackett/Models/IndexerConfig/ConfigurationDataBasicLoginWithFilter.cs new file mode 100644 index 000000000..10a029db2 --- /dev/null +++ b/src/Jackett/Models/IndexerConfig/ConfigurationDataBasicLoginWithFilter.cs @@ -0,0 +1,30 @@ +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.IndexerConfig +{ + public class ConfigurationDataBasicLoginWithFilter : ConfigurationData + { + public StringItem Username { get; private set; } + public StringItem Password { get; private set; } + public DisplayItem FilterExample { get; private set; } + public StringItem FilterString { get; private set; } + + public ConfigurationDataBasicLoginWithFilter(string FilterInstructions) + { + Username = new StringItem { Name = "Username" }; + Password = new StringItem { Name = "Password" }; + FilterExample = new DisplayItem(FilterInstructions) + { + Name = "" + }; + FilterString = new StringItem { Name = "Filters (optional)" }; + } + + + } +} diff --git a/src/Jackett/Models/Irc/Channel.cs b/src/Jackett/Models/Irc/Channel.cs new file mode 100644 index 000000000..a3fe03784 --- /dev/null +++ b/src/Jackett/Models/Irc/Channel.cs @@ -0,0 +1,17 @@ +using IrcDotNet; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.Irc +{ + public class Channel + { + public string Id { get; set; } + public string Name { get; set; } + public List Messages { get; } = new List(); + public bool Joined { get; set; } + } +} diff --git a/src/Jackett/Models/Irc/ChannelInfoResult.cs b/src/Jackett/Models/Irc/ChannelInfoResult.cs new file mode 100644 index 000000000..790bd6a8f --- /dev/null +++ b/src/Jackett/Models/Irc/ChannelInfoResult.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.Irc +{ + public class ChannelInfoResult + { + public Network Network { get; set; } + public Channel Channel { get; set; } + } +} diff --git a/src/Jackett/Models/Irc/DTO/ChannelInfo.cs b/src/Jackett/Models/Irc/DTO/ChannelInfo.cs new file mode 100644 index 000000000..ddb41b261 --- /dev/null +++ b/src/Jackett/Models/Irc/DTO/ChannelInfo.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.Irc.DTO +{ + public class ChannelInfo + { + public string Name { get; set;} + public bool Joined { get; set; } + } +} diff --git a/src/Jackett/Models/Irc/DTO/NetworkInfo.cs b/src/Jackett/Models/Irc/DTO/NetworkInfo.cs new file mode 100644 index 000000000..b2855c1e5 --- /dev/null +++ b/src/Jackett/Models/Irc/DTO/NetworkInfo.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.Irc.DTO +{ + public class NetworkInfo + { + public string Name { get; set; } = string.Empty; + public string Address { get; set; } = string.Empty; + public List Channels { get; } = new List(); + } +} diff --git a/src/Jackett/Models/Irc/IRCProfile.cs b/src/Jackett/Models/Irc/IRCProfile.cs new file mode 100644 index 000000000..c528b3cc7 --- /dev/null +++ b/src/Jackett/Models/Irc/IRCProfile.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.Irc +{ + public class IRCProfile + { + public string Id { get; set; } + public string Name { get; set; } + public List Servers { get; set; } = new List(); + public string Username { get; set; } + public string Profile { get; set; } + } +} diff --git a/src/Jackett/Models/Irc/IRCProfiles.cs b/src/Jackett/Models/Irc/IRCProfiles.cs new file mode 100644 index 000000000..33c6db2e7 --- /dev/null +++ b/src/Jackett/Models/Irc/IRCProfiles.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.Irc +{ + public class IRCProfiles + { + public List Profiles { set; get; } = new List(); + } +} diff --git a/src/Jackett/Models/Irc/Message.cs b/src/Jackett/Models/Irc/Message.cs new file mode 100644 index 000000000..d06265ba5 --- /dev/null +++ b/src/Jackett/Models/Irc/Message.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.Irc +{ + public class Message + { + public string Text { get; set; } + public DateTime When { get; set; } = DateTime.Now; + public string From { get; set; } + public MessageType Type { get; set; } = MessageType.Message; + } +} diff --git a/src/Jackett/Models/Irc/MessageType.cs b/src/Jackett/Models/Irc/MessageType.cs new file mode 100644 index 000000000..9800d7655 --- /dev/null +++ b/src/Jackett/Models/Irc/MessageType.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.Irc +{ + public enum MessageType + { + Message, + Notice, + CTCP, + System + } +} diff --git a/src/Jackett/Models/Irc/Network.cs b/src/Jackett/Models/Irc/Network.cs new file mode 100644 index 000000000..5ddb7a794 --- /dev/null +++ b/src/Jackett/Models/Irc/Network.cs @@ -0,0 +1,22 @@ +using IrcDotNet; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.Irc +{ + public class Network + { + public string Id { get; set; } + public string Name { get; set; } = string.Empty; + public string Username { get; set; } = string.Empty; + public List Address { get; set; } = new List(); + public int AddressIndex { set; get; } + public List Channels { get; } = new List(); + public List Messages { get; } = new List(); + public StandardIrcClient Client = null; + public bool UseSSL { set; get; } = false; + } +} diff --git a/src/Jackett/Models/Irc/User.cs b/src/Jackett/Models/Irc/User.cs new file mode 100644 index 000000000..f2dce8324 --- /dev/null +++ b/src/Jackett/Models/Irc/User.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Models.Irc +{ + public class User + { + public string Nickname { get; set; } + } +} diff --git a/src/Jackett/OWINRewriter.cs b/src/Jackett/OWINRewriter.cs new file mode 100644 index 000000000..cfbe134f8 --- /dev/null +++ b/src/Jackett/OWINRewriter.cs @@ -0,0 +1,43 @@ +using Microsoft.Owin; +using Owin; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett +{ + public class OWINRewriter : OwinMiddleware + { + string from; + string to; + + public OWINRewriter(OwinMiddleware next, string from, string to) + : base(next) + { + this.from = from; + this.to = to; + } + + public override async Task Invoke(IOwinContext context) + { + if (context.Request.Path.HasValue && + context.Request.Path.Value.StartsWith(from, StringComparison.InvariantCultureIgnoreCase)) + { + context.Request.Path = new PathString(to); + } + + await Next.Invoke(context); + } + } + + public static class FileServerExtensions + { + public static IAppBuilder Rewrite(this IAppBuilder builder, string from, string to) + { + builder.Use(from, to); + return builder; + } + } +} diff --git a/src/Jackett/Services/AutoDLProcessorService.cs b/src/Jackett/Services/AutoDLProcessorService.cs new file mode 100644 index 000000000..3bc8557c5 --- /dev/null +++ b/src/Jackett/Services/AutoDLProcessorService.cs @@ -0,0 +1,68 @@ +using Jackett.Models.AutoDL.Parser; +using Jackett.Models.Commands.IRC; +using MediatR; +using NLog; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Services +{ + public interface IAutoDLProcessorService + { + + } + + public class AutoDLProcessorService : IAutoDLProcessorService, INotificationHandler + { + IAutoDLProfileService autodlProfileService; + IIRCProfileService ircProfileService; + Logger logger; + + public AutoDLProcessorService(IAutoDLProfileService a, IIRCProfileService p, Logger l) + { + this.autodlProfileService = a; + this.ircProfileService = p; + this.logger = l; + } + + public void Handle(IRCMessageEvent notification) + { + var profile = ircProfileService.Get(notification.Profile); + if (profile != null) + { + var tracker = autodlProfileService.GetTracker(profile.Profile); + if (tracker != null) + { + ParseMessage(tracker.Parser, tracker.Type, notification.Channel, notification.From, notification.Message); + } + } + } + + private void ParseMessage(ParseInfo info, string profile, string channel, string user, string message) + { + + + foreach(var single in info.SingleLineMatches) + { + var state = new ParserState() + { + CurrentItem = message, + Logger = this.logger, + Tracker = profile + }; + var matchedStates = single.Execute(state); + + foreach(var matchedState in matchedStates) + { + foreach(var matcedParser in info.MatchParsers) + { + var ok = matcedParser.Execute(matchedState); + } + } + } + } + } +} diff --git a/src/Jackett/Services/AutoDLProfileService.cs b/src/Jackett/Services/AutoDLProfileService.cs new file mode 100644 index 000000000..576a2721d --- /dev/null +++ b/src/Jackett/Services/AutoDLProfileService.cs @@ -0,0 +1,403 @@ +using CuttingEdge.Conditions; +using Jackett.Models.AutoDL; +using Jackett.Models.AutoDL.Parser; +using NLog; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Jackett.Services +{ + public interface IAutoDLProfileService { + void Load(); + List GetNetworks(); + List GetProfiles(); + void Set(AutoDLProfileSummary profile); + TrackerInfo GetTracker(string id); + } + + class AutoDLProfileService : IAutoDLProfileService + { + private IConfigurationService configSerivce; + private List trackers = new List(); + Logger logger; + + + public AutoDLProfileService(IConfigurationService c, Logger l) + { + configSerivce = c; + logger = l; + Load(); + } + + public List GetProfiles() + { + return trackers.Select(t => new AutoDLProfileSummary() + { + LongName = t.LongName, + Options = t.Options, + ShortName = t.ShortName, + SiteName= t.SiteName, + Type = t.Type + }).ToList(); + } + + public TrackerInfo GetTracker(string id) + { + return trackers.Where(t => t.Type == "tl").First(); + } + + public void Set(AutoDLProfileSummary profile) + { + var tracker = trackers.Where(t => t.Type == profile.Type).FirstOrDefault(); + if (tracker != null) + { + tracker.IsConfigured = true; + tracker.Options = profile.Options; + } + + Save(); + } + + private void Save() + { + var config = new SavedAutoDLConfigurations() + { + Configurations = trackers.Where(t => t.IsConfigured).Select(t => + { + return new SavedAutoDLConfig() + { + Type = t.Type, + Options = t.Options.Where(o=>!string.IsNullOrWhiteSpace(o.Name)).ToDictionary(c => c.Name, c => c.Value) + }; + }).ToList() + }; + + configSerivce.SaveConfig(config); + } + + public void Load() + { + trackers.Clear(); + + foreach (var path in Directory.GetFiles(configSerivce.GetAutoDLFolder(), "*.tracker")) + { + var xml = XDocument.Load(path); + var info = new TrackerInfo() + { + FileName = Path.GetFileName(path), + LongName = xml.Root.AttributeString("longName"), + ShortName = xml.Root.AttributeString("shortName"), + SiteName = xml.Root.AttributeString("siteName"), + Type = xml.Root.AttributeString("type") + }; + + Condition.Requires(info.FileName, "FileName").IsNotNullOrWhiteSpace(); + Condition.Requires(info.LongName, "LongName").IsNotNullOrWhiteSpace(); + Condition.Requires(info.ShortName, "ShortName").IsNotNullOrWhiteSpace(); + // Condition.Requires(info.SiteName, "SiteName").IsNotNullOrWhiteSpace(); + Condition.Requires(info.Type, "Type").IsNotNullOrWhiteSpace(); + + info.Options.Add(new ConfigOption() + { + Name = "enabled", + Label = "Enabled", + DefaultValue = "true", + Type = ConfigOptionType.Bool + }); + + info.Options.Add(new ConfigOption() + { + Name = "upload-delay-secs", + Label = "Delay", + Tooltip = "Wait this many seconds before uploading/saving the torrent. Default is 0.", + DefaultValue = "0", + Type = ConfigOptionType.Integer + }); + + info.Options.Add(new ConfigOption() + { + Name = "force-ssl", + Label = "Force HTTPS (SSL) downloads", + Tooltip = "If checked, all torrent file downloads from this tracker will be forced to use the HTTPS protocol. Not all trackers support this.", + DefaultValue = "false", + Type = ConfigOptionType.Bool + }); + + foreach (var setting in xml.Root.Element("settings").Elements()) + { + var tag = setting.Name; + var option = new ConfigOption() + { + Name = setting.AttributeString("name"), + DefaultValue = setting.AttributeString("defaultValue") ?? string.Empty, + Label = setting.AttributeString("text"), + EmptyText = setting.AttributeString("emptytext"), + Tooltip = setting.AttributeString("tooltiptext"), + PasteGroup = setting.AttributeString("pasteGroup"), + PasteRegex = setting.AttributeString("pasteRegex"), + MinValue = setting.AttributeString("minValue"), + MaxValue = setting.AttributeString("maxValue"), + IsDownloadVar = setting.AttributeString("name") == "true" + }; + + if (!string.IsNullOrEmpty(setting.AttributeString("type"))) + option.Type = (ConfigOptionType)Enum.Parse(typeof(ConfigOptionType), setting.AttributeString("type"), true); + + if (tag == "gazelle_description" || tag == "description" || tag == "cookie_description") + { + option.Type = ConfigOptionType.Description; + option.Label = "Paste (Ctrl+V) any torrent download link into any one of the two text boxes below to automatically extract authkey and torrent_pass."; + } + else if (tag == "gazelle_authkey" || tag == "authkey") + { + option.Type = ConfigOptionType.TextBox; + option.Name = "authkey"; + option.Label = "authkey"; + option.Tooltip = "The authkey in any torrent download link."; + option.PasteGroup = "authkey,torrent_pass"; + option.PasteRegex = "[\\?&]authkey=([\\da-zA-Z]{32})"; + } + else if (tag == "gazelle_torrent_pass") + { + option.Type = ConfigOptionType.TextBox; + option.Name = "torrent_pass"; + option.Label = "torrent_pass"; + option.Tooltip = "The torrent_pass in any torrent download link."; + option.PasteGroup = "authkey,torrent_pass"; + option.PasteRegex = "[\\?&]torrent_pass=([\\da-zA-Z]{32})"; + } + else if (tag == "description") + { + option.Type = ConfigOptionType.Description; + } + else if (tag == "authkey") + { + option.Type = ConfigOptionType.TextBox; + option.Name = "authkey"; + option.Label = "authkey"; + option.Tooltip = "The authkey in any torrent download link."; + option.PasteGroup = "authkey"; + option.PasteRegex = "[\\?&]authkey=([\\da-fA-F]{32})"; + } + else if (tag == "passkey") + { + option.Type = ConfigOptionType.TextBox; + option.Name = "passkey"; + option.Label = "passkey"; + option.Tooltip = "The passkey in any torrent download link."; + option.PasteGroup = "passkey"; + option.PasteRegex = "[\\?&]passkey=([\\da-fA-F]{32})"; + } + else if (tag == "cookie") + { + option.Type = ConfigOptionType.TextBox; + option.Name = "cookie"; + option.Label = "Log in to your tracker's home page with your browser.

Chrome: Options Menu -> Privacy -> Content Settings -> All cookies and site data
Firefox: Firefox Menu -> Options -> Privacy -> Show cookies
Safari: Action Menu -> Preferences -> Privacy -> Details

Find your tracker site in the cookie or file list.The values needed may vary between trackers. Often these are _uid_ and _pass_.
Set the cookie like uid=XXX; pass=YYY, separating each key=value pair with a semicolon."; + option.Tooltip = "The cookie."; + } + else if (tag == "integer") + { + option.Type = ConfigOptionType.Integer; + option.MinValue = "-999999999"; + } + else if (tag == "delta") + { + option.Type = ConfigOptionType.Integer; + option.Name = "delta"; + option.Label = "Torrent ID delta"; + option.MinValue = "-999999999"; + } + else if (tag == "textbox") + { + option.Type = ConfigOptionType.TextBox; + option.Tooltip = $"{info.LongName} {setting.Name}"; + } + + if (string.IsNullOrWhiteSpace(option.Label)) + option.Label = option.Name; + if (!option.Type.HasValue) + throw new Exception($"No option type specified for setting {tag} on tracker {info.LongName}"); + + info.Options.Add(option); + } + + foreach (var server in xml.Root.Element("servers").Elements()) + { + var serverInfo = new ServerInfo() + { + Announcers = server.AttributeStringList("announcerNames"), + Channels = server.AttributeStringList("channelNames"), + Network = server.AttributeString("network"), + Servers = server.AttributeStringList("serverNames"), + }; + + info.Servers.Add(serverInfo); + } + + foreach (var node in xml.Root.Element("parseinfo").Elements()) + { + switch (node.Name.ToString()) + { + case "multilinepatterns": + // todo + break; + case "linepatterns": + info.Parser.SingleLineMatches.Add(new Models.AutoDL.Parser.LinePatterns() + { + Children = ParseCommands(node) + }); + break; + case "linematched": + info.Parser.MatchParsers.Add(new Models.AutoDL.Parser.LineMatched() + { + Children = ParseCommands(node) + }); + break; + case "ignore": + info.Parser.IgnoreMatches.Add(new Models.AutoDL.Parser.Ignore() + { + Children = ParseCommands(node) + }); + break; + } + } + + logger.Trace($"Loaded {info.FileName}"); + trackers.Add(info); + } + + logger.Trace($"Loaded {trackers.Count} irc profiles."); + + var savedConfig = configSerivce.GetConfig(); + if (savedConfig != null) + { + foreach(var config in savedConfig.Configurations) + { + var tracker = trackers.Where(t => t.Type == config.Type).FirstOrDefault(); + if (tracker != null) + { + tracker.IsConfigured = true; + foreach(var savedOption in config.Options) + { + var trackerOption = tracker.Options.Where(o => o.Name == savedOption.Key).FirstOrDefault(); + if (trackerOption != null) + { + trackerOption.Value = savedOption.Value; + } + } + } + } + } + } + + private List ParseCommands(XElement node) + { + var subCommands = new List(); + foreach(var childNode in node.Elements()) + { + IParserCommand parsedAction = null; + switch (childNode.Name.ToString().ToLowerInvariant()) + { + case "extract": + parsedAction = new Extract(); + break; + case "http": + parsedAction = new Http(childNode); + break; + case "ignore": + parsedAction = new Ignore(); + break; + case "regex": + parsedAction = new Regex(childNode); + break; + case "string": + parsedAction = new Models.AutoDL.Parser.String(childNode); + break; + case "var": + parsedAction = new Var(childNode); + break; + case "varenc": + parsedAction = new VarEnc(childNode); + break; + case "varreplace": + parsedAction = new VarReplace(childNode); + break; + case "vars": + parsedAction = new Vars(childNode); + break; + case "setregex": + parsedAction = new SetRegex(childNode); + break; + case "if": + parsedAction = new If(childNode); + break; + case "extractone": + parsedAction = new ExtractOne(childNode); + break; + case "extracttags": + parsedAction = new ExtractTags(childNode); + break; + case "setvarif": + parsedAction = new SetVarIf(childNode); + break; + } + + if (parsedAction == null) + { + var msg = "Failed to parse AutoDL action: " + childNode.Name; + logger.Error(msg); + //throw new Exception(msg); + } + + var baseCommand = parsedAction as BaseParserCommand; + if (baseCommand != null) + { + baseCommand.Children = ParseCommands(childNode); + } + + subCommands.Add(parsedAction); + } + + return subCommands; + } + + public List GetNetworks() + { + var list = new List(); + + // Default profile + list.Add(new NetworkSummary() + { + Name = "Other network" + }); + + // Freenode + list.Add(new NetworkSummary() + { + Name = "FreeNode", + Servers =new List() + { + "chat.freenode.net" + } + }); + + foreach(var networkGroup in trackers.Where(t=>t.Servers.Count>0).GroupBy(t=>t.Servers.First().Network.ToLowerInvariant())) + { + var summary = new NetworkSummary() + { + Name = networkGroup.First().Servers.First().Network, + Profiles = networkGroup.Select(p=>p.LongName).ToList(), + Servers = networkGroup.SelectMany(p=>p.Servers).SelectMany(s=>s.Servers).Select(s=>s.ToLowerInvariant().Trim()).Distinct().ToList() + }; + list.Add(summary); + } + + return list; + } + } +} diff --git a/src/Jackett/Services/ConfigurationService.cs b/src/Jackett/Services/ConfigurationService.cs index 6c9b78216..dbdaa7744 100644 --- a/src/Jackett/Services/ConfigurationService.cs +++ b/src/Jackett/Services/ConfigurationService.cs @@ -1,241 +1,258 @@ -using Jackett.Utils; -using Newtonsoft.Json.Linq; -using NLog; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Security.AccessControl; -using System.Security.Principal; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace Jackett.Services -{ - public interface IConfigurationService - { - string GetContentFolder(); - string GetVersion(); - string GetIndexerConfigDir(); - string GetAppDataFolder(); - string GetSonarrConfigFile(); - T GetConfig(); - void SaveConfig(T config); - string ApplicationFolder(); - void CreateOrMigrateSettings(); - void PerformMigration(); - } - - public class ConfigurationService : IConfigurationService - { - private ISerializeService serializeService; - private Logger logger; - private IProcessService processService; - - public ConfigurationService(ISerializeService s, IProcessService p, Logger l) - { - serializeService = s; - logger = l; - processService = p; - CreateOrMigrateSettings(); - } - - public void CreateOrMigrateSettings() - { - try - { - if (!Directory.Exists(GetAppDataFolder())) - { - var dir = Directory.CreateDirectory(GetAppDataFolder()); - if (System.Environment.OSVersion.Platform != PlatformID.Unix) - { - var access = dir.GetAccessControl(); - access.AddAccessRule(new FileSystemAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), FileSystemRights.FullControl, InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit, PropagationFlags.None, AccessControlType.Allow)); - Directory.SetAccessControl(GetAppDataFolder(), access); - } - } - - logger.Debug("App config/log directory: " + GetAppDataFolder()); - } - catch (Exception ex) - { - throw new Exception("Could not create settings directory. " + ex.Message); - } - - if (System.Environment.OSVersion.Platform != PlatformID.Unix) - { - try - { - string oldDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Jackett"); - if (Directory.Exists(oldDir)) - { - - // On Windows we need admin permissions to migrate as they were made with admin permissions. - if (ServerUtil.IsUserAdministrator()) - { - PerformMigration(); - } - else - { - try - { - processService.StartProcessAndLog(Application.ExecutablePath, "--MigrateSettings", true); - } - catch - { - Engine.Logger.Error("Unable to migrate settings when not running as administrator."); - Environment.ExitCode = 1; - return; - } - } - } - else - { - PerformMigration(); - } - - } - catch (Exception ex) - { - logger.Error("ERROR could not migrate settings directory " + ex); - } - } - } - - public void PerformMigration() - { - var oldDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Jackett"); - if (Directory.Exists(oldDir)) - { - foreach (var file in Directory.GetFiles(oldDir, "*", SearchOption.AllDirectories)) - { - var path = file.Replace(oldDir, ""); - var destPath = GetAppDataFolder() + path; - var destFolder = Path.GetDirectoryName(destPath); - if (!Directory.Exists(destFolder)) - { - var dir = Directory.CreateDirectory(destFolder); - var access = dir.GetAccessControl(); - access.AddAccessRule(new FileSystemAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), FileSystemRights.FullControl, InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit, PropagationFlags.None, AccessControlType.Allow)); - Directory.SetAccessControl(destFolder, access); - } - if (!File.Exists(destPath)) - { - File.Copy(file, destPath); - // The old files were created when running as admin so make sure they are editable by normal users / services. - if (System.Environment.OSVersion.Platform != PlatformID.Unix) - { - var access = File.GetAccessControl(destPath); - access.AddAccessRule(new FileSystemAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow)); - File.SetAccessControl(destPath, access); - } - } - } - Directory.Delete(oldDir, true); - } - } - - public T GetConfig() - { - var type = typeof(T); - var fullPath = Path.Combine(GetAppDataFolder(), type.Name + ".json"); - try - { - if (!File.Exists(fullPath)) - { - logger.Debug("Config file does not exist: " + fullPath); - return default(T); - } - - return serializeService.DeSerialise(File.ReadAllText(fullPath)); - } - catch (Exception e) - { - logger.Error(e, "Error reading config file " + fullPath); - return default(T); - } - } - - public void SaveConfig(T config) - { - var type = typeof(T); - var fullPath = Path.Combine(GetAppDataFolder(), type.Name + ".json"); - try - { - var json = serializeService.Serialise(config); - if (!Directory.Exists(GetAppDataFolder())) - Directory.CreateDirectory(GetAppDataFolder()); - File.WriteAllText(fullPath, json); - } - catch (Exception e) - { - logger.Error(e, "Error reading config file " + fullPath); - } - } - - public string ApplicationFolder() - { - return Path.GetDirectoryName(Application.ExecutablePath); - } - - public string GetContentFolder() - { - // If we are debugging we can use the non copied content. - string dir = Path.Combine(ApplicationFolder(), "Content"); ; - -#if DEBUG - // When we are running in debug use the source files - var sourcePath = Path.GetFullPath(Path.Combine(ApplicationFolder(), "..\\..\\..\\Jackett\\Content")); - if (Directory.Exists(sourcePath)) - { - dir = sourcePath; - } -#endif - return dir; - } - - public string GetVersion() - { - return Assembly.GetExecutingAssembly().GetName().Version.ToString(); - } - - public string GetAppDataFolder() - { - return GetAppDataFolderStatic(); - } - - /// - /// This is needed for the logger prior to ioc setup. - /// - /// - public static string GetAppDataFolderStatic() - { - if (System.Environment.OSVersion.Platform == PlatformID.Unix) - { - return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Jackett"); - } - else - { - return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Jackett"); - } - } - - public string GetIndexerConfigDir() - { - return Path.Combine(GetAppDataFolder(), "Indexers"); - } - - public string GetConfigFile() - { - return Path.Combine(GetAppDataFolder(), "config.json"); - } - - public string GetSonarrConfigFile() - { - return Path.Combine(GetAppDataFolder(), "sonarr_api.json"); - } - } -} +using Jackett.Utils; +using Newtonsoft.Json.Linq; +using NLog; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Security.AccessControl; +using System.Security.Principal; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Jackett.Services +{ + public interface IConfigurationService + { + string GetContentFolder(); + string GetVersion(); + string GetIndexerConfigDir(); + string GetAppDataFolder(); + string GetSonarrConfigFile(); + T GetConfig(); + void SaveConfig(T config); + string ApplicationFolder(); + void CreateOrMigrateSettings(); + void PerformMigration(); + string GetAutoDLFolder(); + } + + public class ConfigurationService : IConfigurationService + { + private ISerializeService serializeService; + private Logger logger; + private IProcessService processService; + + public ConfigurationService(ISerializeService s, IProcessService p, Logger l) + { + serializeService = s; + logger = l; + processService = p; + CreateOrMigrateSettings(); + } + + public void CreateOrMigrateSettings() + { + try + { + if (!Directory.Exists(GetAppDataFolder())) + { + var dir = Directory.CreateDirectory(GetAppDataFolder()); + if (System.Environment.OSVersion.Platform != PlatformID.Unix) + { + var access = dir.GetAccessControl(); + access.AddAccessRule(new FileSystemAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), FileSystemRights.FullControl, InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit, PropagationFlags.None, AccessControlType.Allow)); + Directory.SetAccessControl(GetAppDataFolder(), access); + } + } + + logger.Debug("App config/log directory: " + GetAppDataFolder()); + } + catch (Exception ex) + { + throw new Exception("Could not create settings directory. " + ex.Message); + } + + if (System.Environment.OSVersion.Platform != PlatformID.Unix) + { + try + { + string oldDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Jackett"); + if (Directory.Exists(oldDir)) + { + + // On Windows we need admin permissions to migrate as they were made with admin permissions. + if (ServerUtil.IsUserAdministrator()) + { + PerformMigration(); + } + else + { + try + { + processService.StartProcessAndLog(Application.ExecutablePath, "--MigrateSettings", true); + } + catch + { + Engine.Logger.Error("Unable to migrate settings when not running as administrator."); + Environment.ExitCode = 1; + return; + } + } + } + else + { + PerformMigration(); + } + + } + catch (Exception ex) + { + logger.Error("ERROR could not migrate settings directory " + ex); + } + } + } + + public void PerformMigration() + { + var oldDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Jackett"); + if (Directory.Exists(oldDir)) + { + foreach (var file in Directory.GetFiles(oldDir, "*", SearchOption.AllDirectories)) + { + var path = file.Replace(oldDir, ""); + var destPath = GetAppDataFolder() + path; + var destFolder = Path.GetDirectoryName(destPath); + if (!Directory.Exists(destFolder)) + { + var dir = Directory.CreateDirectory(destFolder); + var access = dir.GetAccessControl(); + access.AddAccessRule(new FileSystemAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), FileSystemRights.FullControl, InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit, PropagationFlags.None, AccessControlType.Allow)); + Directory.SetAccessControl(destFolder, access); + } + if (!File.Exists(destPath)) + { + File.Copy(file, destPath); + // The old files were created when running as admin so make sure they are editable by normal users / services. + if (System.Environment.OSVersion.Platform != PlatformID.Unix) + { + var access = File.GetAccessControl(destPath); + access.AddAccessRule(new FileSystemAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), FileSystemRights.FullControl, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow)); + File.SetAccessControl(destPath, access); + } + } + } + Directory.Delete(oldDir, true); + } + } + + public T GetConfig() + { + var type = typeof(T); + var fullPath = Path.Combine(GetAppDataFolder(), type.Name + ".json"); + try + { + if (!File.Exists(fullPath)) + { + logger.Debug("Config file does not exist: " + fullPath); + return default(T); + } + + return serializeService.DeSerialise(File.ReadAllText(fullPath)); + } + catch (Exception e) + { + logger.Error(e, "Error reading config file " + fullPath); + return default(T); + } + } + + public void SaveConfig(T config) + { + var type = typeof(T); + var fullPath = Path.Combine(GetAppDataFolder(), type.Name + ".json"); + try + { + var json = serializeService.Serialise(config); + if (!Directory.Exists(GetAppDataFolder())) + Directory.CreateDirectory(GetAppDataFolder()); + File.WriteAllText(fullPath, json); + } + catch (Exception e) + { + logger.Error(e, "Error reading config file " + fullPath); + } + } + + public string ApplicationFolder() + { + return Path.GetDirectoryName(Application.ExecutablePath); + } + + public string GetContentFolder() + { + // If we are debugging we can use the non copied content. + string dir = Path.Combine(ApplicationFolder(), "Content"); ; + +#if DEBUG + // When we are running in debug use the source files + var sourcePath = Path.GetFullPath(Path.Combine(ApplicationFolder(), "..\\..\\..\\Jackett\\Content")); + if (Directory.Exists(sourcePath)) + { + dir = sourcePath; + } +#endif + return dir; + } + + public string GetAutoDLFolder() + { + // If we are debugging we can use the non copied content. + string dir = Path.Combine(ApplicationFolder(), "autodl-trackers"); ; + +#if DEBUG + // When we are running in debug use the source files + var sourcePath = Path.GetFullPath(Path.Combine(ApplicationFolder(), "..\\..\\..\\Jackett\\autodl-trackers")); + if (Directory.Exists(sourcePath)) + { + dir = sourcePath; + } +#endif + return dir; + } + + public string GetVersion() + { + return Assembly.GetExecutingAssembly().GetName().Version.ToString(); + } + + public string GetAppDataFolder() + { + return GetAppDataFolderStatic(); + } + + /// + /// This is needed for the logger prior to ioc setup. + /// + /// + public static string GetAppDataFolderStatic() + { + if (System.Environment.OSVersion.Platform == PlatformID.Unix) + { + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Jackett"); + } + else + { + return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Jackett"); + } + } + + public string GetIndexerConfigDir() + { + return Path.Combine(GetAppDataFolder(), "Indexers"); + } + + public string GetConfigFile() + { + return Path.Combine(GetAppDataFolder(), "config.json"); + } + + public string GetSonarrConfigFile() + { + return Path.Combine(GetAppDataFolder(), "sonarr_api.json"); + } + } +} diff --git a/src/Jackett/Services/IDService.cs b/src/Jackett/Services/IDService.cs new file mode 100644 index 000000000..f66d4b9e4 --- /dev/null +++ b/src/Jackett/Services/IDService.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Services +{ + public interface IIDService + { + string NewId(); + } + + class IDService : IIDService + { + public string NewId() + { + return Guid.NewGuid().ToString("N"); + } + } +} diff --git a/src/Jackett/Services/IRCProfileService.cs b/src/Jackett/Services/IRCProfileService.cs new file mode 100644 index 000000000..a7495094d --- /dev/null +++ b/src/Jackett/Services/IRCProfileService.cs @@ -0,0 +1,101 @@ +using CuttingEdge.Conditions; +using Jackett.Models.Commands.IRC; +using Jackett.Models.Irc; +using MediatR; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Services +{ + public interface IIRCProfileService + { + IRCProfile Get(string name); + void Set(IRCProfile profile); + List All { get; } + void Delete(string name); + void Load(); + } + + public class IRCProfileService: IIRCProfileService + { + List profiles = new List(); + IMediator mediator; + IIDService idService; + IConfigurationService configService; + + public IRCProfileService(IMediator m, IIDService i, IConfigurationService c) + { + mediator = m; + idService = i; + configService = c; + } + + public void Save() + { + var config = new IRCProfiles() + { + Profiles = this.profiles + }; + + configService.SaveConfig(config); + } + + public void Load() + { + var config = configService.GetConfig(); + if (config != null) + { + this.profiles = config.Profiles; + } + } + + public IRCProfile Get(string id) + { + return profiles.Where(p => string.Equals(p.Id, id, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault(); + } + + public void Set(IRCProfile profile) + { + Condition.Requires(profile.Name, "Name").IsNotNullOrWhiteSpace(); + + if (profile.Id == null) + { + profile.Id = idService.NewId(); + } + else + { + var existing = Get(profile.Id); + if (existing != null) + { + profiles.Remove(existing); + } + } + + profiles.Add(profile); + mediator.Publish(new AddProfileEvent() { Profile = profile }); + Save(); + } + + public List All + { + get + { + return profiles; + } + } + + public void Delete(string name) + { + var existing = Get(name); + if (existing != null) + { + profiles.Remove(existing); + } + + Save(); + } + } +} diff --git a/src/Jackett/Services/IRCService.cs b/src/Jackett/Services/IRCService.cs new file mode 100644 index 000000000..b9001aeda --- /dev/null +++ b/src/Jackett/Services/IRCService.cs @@ -0,0 +1,824 @@ +using IrcDotNet; +using IrcDotNet.Ctcp; +using Jackett.Models.Commands; +using Jackett.Models.Commands.IRC; +using Jackett.Models.DTO; +using Jackett.Models.Irc; +using Jackett.Models.Irc.DTO; +using Jackett.Utils; +using MediatR; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using MoreLinq; +using NLog; + +namespace Jackett.Services +{ + public interface IIRCService + { + List GetSummary(); + List GetMessages(string network, string channel); + List GetUser(string network, string channel); + void ProcessCommand(string networkId, string channelId, string command); + void CreateNetworkFromProfile(IRCProfile profile); + } + + public class IRCService : IIRCService, INotificationHandler + { + List networks = new List(); + IIDService idService = null; + IMediator mediator; + Logger logger; + + public IRCService(IIDService i, IMediator m, Logger l) + { + idService = i; + mediator = m; + logger = l; + } + + public List GetMessages(string networkId, string channelId) + { + var network = networks.Where(n => n.Id == networkId).FirstOrDefault(); + if (network == null) + return new List(); + if (string.IsNullOrEmpty(channelId)) + { + return network.Messages.TakeLast(100).ToList(); + } + + var channel = network.Channels.Where(c => c.Id == channelId).FirstOrDefault(); + return channel.Messages.TakeLast(100).ToList(); + } + + public List GetUser(string networkId, string channelId) + { + var network = networks.Where(n => n.Id == networkId).FirstOrDefault(); + if (network == null) + return new List(); + if (channelId == "server") + { + // Network room + return new List() + { + new User() + { + Nickname = network.Client.LocalUser.NickName + } + }; + } + + + var channel = network.Channels.Where(c => c.Id == channelId).FirstOrDefault(); + if(channel==null) + return new List(); + var channelObj = network.Client.Channels.Where(c => c.Name == channel.Name).FirstOrDefault(); + if (channelObj == null) + return new List(); + return channelObj.Users.Select(u => new User() { Nickname = u.User.NickName }).ToList(); + } + + public void ProcessCommand(string networkId, string channelId, string command) + { + var network = networks.Where(n => n.Id == networkId).FirstOrDefault(); + Channel channel = null; + if (null != network) + { + channel = network.Channels.Where(c => c.Id == channelId).FirstOrDefault(); + } + + if (string.IsNullOrWhiteSpace(command)) + return; + + if (command.StartsWith("/join")) + { + network.Client.Channels.Join(command.Split(" ".ToArray())[1]); + } + else if(command == "/leave" && channel != null) + { + network.Client.Channels.Leave(channel.Name); + } + else + { + if (channel == null) + { + network.Client.SendRawMessage(command); + } else + { + network.Client.LocalUser.SendMessage(channel.Name, command); + channel.Messages.Add(new Message() + { + From = network.Client.LocalUser.NickName, + Text = command, + Type = MessageType.Message + }); + NotifyChannelChange(channel); + } + } + } + + private void NotifyChannelChange(Channel c) + { + mediator.Publish(new IRCMessageEvent() { Channel = c.Id }); + } + + private void NotifyNetworkChange(Network n) + { + mediator.Publish(new IRCMessageEvent() { Channel = n.Id }); + } + + public List GetSummary() + { + var list = new List(); + foreach(var network in networks) + { + var d = new NetworkDTO(); + d.Name = network.Name; + d.Id = network.Id; + foreach(var c in network.Channels) + { + d.Channels.Add(new ChannelDTO() + { + Name = c.Name, + Id = c.Id + }); + } + list.Add(d); + } + + return list; + } + + public void Start() + { + + + /* foreach(var network in networks) + { + SetupNetwork(network); + Connect(network); + }*/ + } + + private void SetupNetwork(Network network) + { + var client = network.Client = new StandardIrcClient(); + client.FloodPreventer = new IrcStandardFloodPreventer(4, 2000); + client.Registered += Client_Registered; + client.Disconnected += Client_Disconnected; + client.ClientInfoReceived += Client_ClientInfoReceived; + client.Error += Client_Error; + client.ErrorMessageReceived += Client_ErrorMessageReceived; + client.MotdReceived += Client_MotdReceived; + client.ProtocolError += Client_ProtocolError; + client.ChannelListReceived += Client_ChannelListReceived; + client.ConnectFailed += Client_ConnectFailed; + client.NetworkInformationReceived += Client_NetworkInformationReceived; + client.PingReceived += Client_PingReceived; + client.PongReceived += Client_PongReceived; + client.ServerBounce += Client_ServerBounce; + client.ServerStatsReceived += Client_ServerStatsReceived; + client.ServerTimeReceived += Client_ServerTimeReceived; + client.ServerSupportedFeaturesReceived += Client_ServerSupportedFeaturesReceived; + client.ServerVersionInfoReceived += Client_ServerVersionInfoReceived; + client.WhoIsReplyReceived += Client_WhoIsReplyReceived; + client.WhoReplyReceived += Client_WhoReplyReceived; + client.WhoWasReplyReceived += Client_WhoWasReplyReceived; + + var ctcpClient = new CtcpClient(client); + ctcpClient.ClientVersion = "Jackett " + Engine.ConfigService.GetVersion(); + ctcpClient.PingResponseReceived += CtcpClient_PingResponseReceived; + ctcpClient.VersionResponseReceived += CtcpClient_VersionResponseReceived; + ctcpClient.TimeResponseReceived += CtcpClient_TimeResponseReceived; + ctcpClient.ActionReceived += CtcpClient_ActionReceived; + + networks.Add(network); + } + + private void Client_Registered(object sender, EventArgs e) + { + var client = (IrcClient)sender; + + client.LocalUser.NoticeReceived += LocalUser_NoticeReceived; + client.LocalUser.MessageReceived += LocalUser_MessageReceived; + client.LocalUser.JoinedChannel += LocalUser_JoinedChannel; + client.LocalUser.LeftChannel += LocalUser_LeftChannel; + client.LocalUser.InviteReceived += LocalUser_InviteReceived; + client.LocalUser.IsAwayChanged += LocalUser_IsAwayChanged; + client.LocalUser.ModesChanged += LocalUser_ModesChanged; + client.LocalUser.NickNameChanged += LocalUser_NickNameChanged; + mediator.Publish(new IRCStateChangedEvent()); + } + + private void LocalUser_JoinedChannel(object sender, IrcChannelEventArgs e) + { + var localUser = (IrcLocalUser)sender; + var details = GetChannelFromEvent(e); + details.Channel.Joined = true; + + e.Channel.UserJoined += Channel_UserJoined; + e.Channel.MessageReceived += Channel_MessageReceived; + e.Channel.ModesChanged += Channel_ModesChanged; + e.Channel.NoticeReceived += Channel_NoticeReceived; + e.Channel.TopicChanged += Channel_TopicChanged; + e.Channel.UserInvited += Channel_UserInvited; + e.Channel.UserKicked += Channel_UserKicked; + e.Channel.UserLeft += Channel_UserLeft; + e.Channel.UsersListReceived += Channel_UsersListReceived; + + details.Network.Channels.Add(details.Channel); + mediator.Publish(new IRCStateChangedEvent()); + } + + private Network NetworkFromIrcClient(StandardIrcClient client) + { + return networks.Where(n => n.Client.ToString() == client.ToString()).First(); + } + + private Network NetworkFromIrcClient(IrcLocalUser user) + { + return NetworkFromIrcClient((StandardIrcClient)user.Client); + } + + private void BroadcastMessageToNetwork(Network network, Message message) + { + network.Messages.Add(message); + NotifyNetworkChange(network); + foreach (var channel in network.Channels) + { + channel.Messages.Add(message); + NotifyChannelChange(channel); + } + } + + private void CtcpClient_ActionReceived(object sender, CtcpMessageEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + BroadcastMessageToNetwork(network, new Message() + { + From = e.Source.NickName, + Text = e.Text, + Type = MessageType.CTCP + }); + NotifyNetworkChange(network); + } + + private void CtcpClient_TimeResponseReceived(object sender, CtcpTimeResponseReceivedEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + BroadcastMessageToNetwork(network, new Message() + { + From = e.User.NickName, + Text = $"Time received: {e.DateTime}", + Type = MessageType.CTCP + }); + NotifyNetworkChange(network); + } + + private void CtcpClient_VersionResponseReceived(object sender, CtcpVersionResponseReceivedEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + BroadcastMessageToNetwork(network, new Message() + { + From = e.User.NickName, + Text = $"Version received: {e.VersionInfo}", + Type = MessageType.CTCP + }); + NotifyNetworkChange(network); + } + + private void CtcpClient_PingResponseReceived(object sender, CtcpPingResponseReceivedEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + network.Messages.Add(new Message() + { + From = e.User.NickName, + Text = $"Ping time: {e.PingTime}", + Type = MessageType.CTCP + }); + NotifyNetworkChange(network); + } + + private void Client_WhoWasReplyReceived(object sender, IrcUserEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + BroadcastMessageToNetwork(network, new Message() + { + From = e.User.NickName, + Text = $"Who was: {e.User.NickName}", + Type = MessageType.System + }); + NotifyNetworkChange(network); + } + + private void Client_WhoReplyReceived(object sender, IrcNameEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + BroadcastMessageToNetwork(network, new Message() + { + From = network.Client.ServerName, + Text = $"Who was: {e.Name}", + Type = MessageType.System + }); + NotifyNetworkChange(network); + } + + private void Client_WhoIsReplyReceived(object sender, IrcUserEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + BroadcastMessageToNetwork(network, new Message() + { + From = network.Client.ServerName, + Text = $"Who is: {e.User.NickName}", + Type = MessageType.System + }); + NotifyNetworkChange(network); + } + + private void Client_ServerVersionInfoReceived(object sender, IrcServerVersionInfoEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + network.Messages.Add(new Message() + { + From = e.ServerName, + Text = $"Server version: {e.Version}", + Type = MessageType.System + }); + NotifyNetworkChange(network); + } + + private void Client_ServerSupportedFeaturesReceived(object sender, EventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + var msg = string.Join(", ", network.Client.ServerSupportedFeatures.Select(f => f.Key + "=" + f.Value)); + + network.Messages.Add(new Message() + { + From = network.Client.ServerName, + Text = "Server features: " + msg, + Type = MessageType.System + }); + NotifyNetworkChange(network); + } + + private void Client_ServerTimeReceived(object sender, IrcServerTimeEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + network.Messages.Add(new Message() + { + From = e.ServerName, + Text = $"Server time: {e.DateTime}", + Type = MessageType.System + }); + NotifyNetworkChange(network); + } + + private void Client_ServerStatsReceived(object sender, IrcServerStatsReceivedEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + foreach (var entry in e.Entries) + { + network.Messages.Add(new Message() + { + From = network.Client.ServerName, + Text = $"Server stats ({entry.Type}) : { string.Join(", ", entry.Parameters)}", + Type = MessageType.System + }); + } + NotifyNetworkChange(network); + } + + private void Client_ServerBounce(object sender, IrcServerInfoEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + BroadcastMessageToNetwork(network, new Message() + { + From = network.Client.ServerName, + Text = $"Server is requesting bounce to: {e.Address}:{e.Port}", + Type = MessageType.System + }); + } + + private void Client_PongReceived(object sender, IrcPingOrPongReceivedEventArgs e) + { + // Ignore + } + + private void Client_PingReceived(object sender, IrcPingOrPongReceivedEventArgs e) + { + // Ignore + } + + private void Client_NetworkInformationReceived(object sender, IrcCommentEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + network.Messages.Add(new Message() + { + From = network.Client.ServerName, + Text = e.Comment, + Type = MessageType.System + }); + NotifyNetworkChange(network); + } + + private void Client_ConnectFailed(object sender, IrcErrorEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + BroadcastMessageToNetwork(network, new Message() + { + From = network.Name, + Text = $"Connect failed", + Type = MessageType.System + }); + } + + private void Client_ChannelListReceived(object sender, IrcChannelListReceivedEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + foreach (var channel in e.Channels) + { + BroadcastMessageToNetwork(network, new Message() + { + From = network.Client.ServerName, + Text = $"Channel: \"{channel.Name}\" Users: {channel.VisibleUsersCount} Topic: \"{channel.Topic}\"", + Type = MessageType.System + }); + } + } + + private void Client_ClientInfoReceived(object sender, EventArgs e) + { + // Ignore ServerName/ServerVersion/ServerAvailableUserModes/ServerAvailableChannelModes is set + } + + private void Client_ProtocolError(object sender, IrcProtocolErrorEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + network.Messages.Add(new Message() + { + From = network.Name, + Text = $"Protocol error ({e.Code}): {e.Message} { string.Join(" ", e.Parameters)}", + Type = MessageType.System + }); + NotifyNetworkChange(network); + } + + private void Client_MotdReceived(object sender, EventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + network.Messages.Add(new Message() + { + From = network.Client.ServerName, + Text = $"MOTD: {network.Client.MessageOfTheDay}", + Type = MessageType.System + }); + NotifyNetworkChange(network); + } + + private void Client_ErrorMessageReceived(object sender, IrcErrorMessageEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + network.Messages.Add(new Message() + { + From = network.Client.ServerName, + Text = $"Network Error: {e.Message}", + Type = MessageType.System + }); + } + + + private void Client_Error(object sender, IrcErrorEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + network.Messages.Add(new Message() + { + From = network.Client.ServerName, + Text = $"Client Error: {e.Error.Message} {e.Error.StackTrace}", + Type = MessageType.System + }); + } + + private void Client_Disconnected(object sender, EventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + BroadcastMessageToNetwork(network, new Message() + { + From = network.Client.ServerName, + Text = "Disconnected", + Type = MessageType.System + }); + + foreach (var channel in network.Channels) + { + channel.Joined = false; + } + } + + private void LocalUser_NickNameChanged(object sender, EventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + BroadcastMessageToNetwork(network, new Message() + { + From = network.Client.ServerName, + Text = $"Nickname changed to {network.Client.LocalUser.NickName}", + Type = MessageType.System + }); + } + + private void LocalUser_ModesChanged(object sender, EventArgs e) + { + var user = sender as IrcLocalUser; + var network = NetworkFromIrcClient((StandardIrcClient)user.Client); + BroadcastMessageToNetwork(network, new Message() + { + From = network.Client.ServerName, + Text = $"Your modes were set to: {String.Join("", network.Client.LocalUser.Modes)}", + Type = MessageType.System + }); + } + + private void LocalUser_IsAwayChanged(object sender, EventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + network.Messages.Add(new Message() + { + From = network.Client.ServerName, + Text = network.Client.LocalUser.IsAway?"You were marked away": "You are no longer marked as away", + Type = MessageType.System + }); + NotifyNetworkChange(network); + } + + private void LocalUser_InviteReceived(object sender, IrcChannelInvitationEventArgs e) + { + var network = NetworkFromIrcClient(sender as StandardIrcClient); + BroadcastMessageToNetwork(network, new Message() + { + From = e.Inviter.NickName, + Text = $"You were invited to: {e.Channel} {e.Comment}", + Type = MessageType.System + }); + } + + private ChannelInfoResult GetChannelFromEvent(IrcChannelEventArgs e) + { + var network = networks.Where(n => n.Client == e.Channel.Client).First(); + var channel = network.Channels.Where(c => c.Name == e.Channel.Name).FirstOrDefault(); + if(channel == null) + { + channel = new Channel() + { + Joined = true, + Name = e.Channel.Name, + Id = idService.NewId() + }; + } + + return new ChannelInfoResult() + { + Network = network, + Channel = channel + }; + } + + private ChannelInfoResult GetChannelInfoFromClientChannel(IrcChannel ircchannel) + { + var network = networks.Where(n => n.Client == ircchannel.Client).First(); + return new ChannelInfoResult() + { + Network = network, + Channel = network.Channels.Where(c => c.Name == ircchannel.Name).FirstOrDefault() + }; + } + + + private Network GetNetworkFromEvent(IrcChannelEventArgs e) + { + return networks.Where(n => n.Client == e.Channel.Client).First(); + } + + private void LocalUser_LeftChannel(object sender, IrcChannelEventArgs e) + { + e.Channel.UserJoined -= Channel_UserJoined; + e.Channel.MessageReceived -= Channel_MessageReceived; + e.Channel.ModesChanged -= Channel_ModesChanged; + e.Channel.NoticeReceived -= Channel_NoticeReceived; + e.Channel.TopicChanged -= Channel_TopicChanged; + e.Channel.UserInvited -= Channel_UserInvited; + e.Channel.UserKicked -= Channel_UserKicked; + e.Channel.UserLeft -= Channel_UserLeft; + e.Channel.UsersListReceived -= Channel_UsersListReceived; + + var network = GetNetworkFromEvent(e); + var channel = GetChannelFromEvent(e); + channel.Channel.Joined = false; + channel.Channel.Messages.Add(new Message() + { + From = network.Client.ServerName, + Text = "You left this channel", + Type = MessageType.System + }); + mediator.Publish(new IRCStateChangedEvent()); + } + + private void Channel_UsersListReceived(object sender, EventArgs e) + { + var info = GetChannelInfoFromClientChannel(sender as IrcChannel); + mediator.Publish(new IRCUsersChangedEvent() { Id = info.Channel.Id }); + } + + private void Channel_UserLeft(object sender, IrcChannelUserEventArgs e) + { + var info = GetChannelInfoFromClientChannel(sender as IrcChannel); + mediator.Publish(new IRCUsersChangedEvent() {Id = info.Channel.Id }); + } + + private void Channel_UserKicked(object sender, IrcChannelUserEventArgs e) + { + var info = GetChannelInfoFromClientChannel(sender as IrcChannel); + info.Channel.Messages.Add(new Message() + { + From = info.Network.Client.ServerName, + Text =$"{e.ChannelUser.User.NickName} was kicked.", + Type = MessageType.System + }); + NotifyChannelChange(info.Channel); + mediator.Publish(new IRCUsersChangedEvent() { Id = info.Channel.Id }); + } + + private void Channel_UserInvited(object sender, IrcUserEventArgs e) + { + var info = GetChannelInfoFromClientChannel(sender as IrcChannel); + info.Channel.Messages.Add(new Message() + { + From = info.Network.Client.ServerName, + Text = $"{e.User.NickName} was invited.", + Type = MessageType.System + }); + NotifyChannelChange(info.Channel); + } + + private void Channel_TopicChanged(object sender, IrcUserEventArgs e) + { + var info = GetChannelInfoFromClientChannel(sender as IrcChannel); + info.Channel.Messages.Add(new Message() + { + From = info.Network.Client.ServerName, + Text = $"Topic: {(sender as IrcChannel).Topic}", + Type = MessageType.System + }); + NotifyChannelChange(info.Channel); + } + + private void Channel_NoticeReceived(object sender, IrcMessageEventArgs e) + { + var info = GetChannelInfoFromClientChannel(sender as IrcChannel); + info.Channel.Messages.Add(new Message() + { + From = e.Source.Name, + Text = e.Text, + Type = MessageType.Notice + }); + NotifyChannelChange(info.Channel); + } + + private void Channel_ModesChanged(object sender, IrcUserEventArgs e) + { + var info = GetChannelInfoFromClientChannel(sender as IrcChannel); + if (info.Channel != null) + { + info.Channel.Messages.Add(new Message() + { + From = e.User==null?string.Empty:e.User.NickName, + Text = $"Channel modes changed to: {(sender as IrcChannel).Modes}", + Type = MessageType.System + }); + NotifyChannelChange(info.Channel); + } + } + + private void Channel_MessageReceived(object sender, IrcMessageEventArgs e) + { + var info = GetChannelInfoFromClientChannel(sender as IrcChannel); + info.Channel.Messages.Add(new Message() + { + From = e.Source.Name, + Text = e.Text, + Type = MessageType.Message + }); + + mediator.Publish(new IRCMessageEvent() { + Channel = info.Channel.Id, + From = e.Source.Name, + Message = e.Text, + Network = info.Network.Id, + Profile = info.Network.Id + }); + // NotifyChannelChange(info.Channel); + } + + private void Channel_UserJoined(object sender, IrcChannelUserEventArgs e) + { + var info = GetChannelInfoFromClientChannel(sender as IrcChannel); + info.Channel.Messages.Add(new Message() + { + From = info.Network.Client.ServerName, + Text = $"User joined: {e.ChannelUser.User.NickName}", + Type = MessageType.System + }); + NotifyChannelChange(info.Channel); + mediator.Publish(new IRCUsersChangedEvent() { Id = info.Channel.Id }); + } + + private void LocalUser_MessageReceived(object sender, IrcMessageEventArgs e) + { + // TODO PM Implementation + var network = NetworkFromIrcClient(sender as IrcLocalUser); // Confirmed + BroadcastMessageToNetwork(network, new Message() + { + From = e.Source.Name, + Text = $"Private message {e.Text}", + Type = MessageType.Message + }); + } + + private void LocalUser_NoticeReceived(object sender, IrcMessageEventArgs e) + { + var network = NetworkFromIrcClient(sender as IrcLocalUser); + BroadcastMessageToNetwork(network, new Message() + { + From = e.Source.Name, + Text = e.Text, + Type = MessageType.Notice + }); + } + + private void Connect(Network network) + { + if (network.Address.Count == 0) + { + logger.Error($"Unable to connect to {network.Name} as it has no servers defined!"); + return; + } + + if (network.AddressIndex + 1 > network.Address.Count) + { + network.AddressIndex = 0; + } + + var address = network.Address[network.AddressIndex]; + + // Bump index so we try the next server should we fail to connect + network.AddressIndex++; + + var port = 6667; + var addr = string.Empty; + var split = address.Split(':'); + if (split.Length > 0) + addr = split[0]; + if (split.Length > 1) + port = ParseUtil.CoerceInt(split[1]); + + network.Client.Connect(addr, port, network.UseSSL, new IrcUserRegistrationInfo() + { + NickName = network.Username, + UserName = network.Username, + RealName = network.Username + }); + + BroadcastMessageToNetwork(network, new Message() + { + From = network.Name, + Text = $"Connecting to {address} ..", + Type = MessageType.System + }); + } + + void INotificationHandler.Handle(AddProfileEvent notification) + { + CreateNetworkFromProfile(notification.Profile); + } + + public void CreateNetworkFromProfile(IRCProfile profile) + { + var network = networks.Where(n => n.Id == profile.Id).FirstOrDefault(); + if (network == null) + { + network = new Network() + { + Id = profile.Id, + Name = profile.Name, + Address = profile.Servers, + Username = profile.Username + }; + + SetupNetwork(network); + Connect(network); + } + } + } +} diff --git a/src/Jackett/Services/ServerService.cs b/src/Jackett/Services/ServerService.cs index c3a324e9c..2a8589eea 100644 --- a/src/Jackett/Services/ServerService.cs +++ b/src/Jackett/Services/ServerService.cs @@ -1,170 +1,198 @@ -using Autofac; -using Jackett.Models.Config; -using Jackett.Services; -using Jackett.Utils; -using Jackett.Utils.Clients; -using Microsoft.Owin.Hosting; -using Newtonsoft.Json.Linq; -using NLog; -using NLog.Config; -using NLog.Targets; -using NLog.Windows.Forms; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Net.NetworkInformation; -using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; -using System.Web; - -namespace Jackett.Services -{ - public interface IServerService - { - void Initalize(); - void Start(); - void Stop(); - void ReserveUrls(bool doInstall = true); - ServerConfig Config { get; } - void SaveConfig(); - Uri ConvertToProxyLink(Uri link, string serverUrl, string indexerId, string action = "dl", string file = "/t.torrent"); - } - - public class ServerService : IServerService - { - private ServerConfig config; - - private IDisposable _server = null; - - private IIndexerManagerService indexerService; - private IProcessService processService; - private ISerializeService serializeService; - private IConfigurationService configService; - private Logger logger; - private IWebClient client; - - public ServerService(IIndexerManagerService i, IProcessService p, ISerializeService s, IConfigurationService c, Logger l, IWebClient w) - { - indexerService = i; - processService = p; - serializeService = s; - configService = c; - logger = l; - client = w; - - LoadConfig(); - } - - public ServerConfig Config - { - get { return config; } - } - - public Uri ConvertToProxyLink(Uri link, string serverUrl, string indexerId, string action = "dl", string file = "/t.torrent") - { - if (link == null || (link.IsAbsoluteUri && link.Scheme == "magnet")) - return link; - - var encodedLink = HttpServerUtility.UrlTokenEncode(Encoding.UTF8.GetBytes(link.ToString())) + file; - var proxyLink = string.Format("{0}{1}/{2}/{3}/{4}", serverUrl, action, indexerId, config.APIKey, encodedLink); - return new Uri(proxyLink); - } - - private void LoadConfig() - { - // Load config - config = configService.GetConfig(); - if (config == null) - { - config = new ServerConfig(); - } - - if (string.IsNullOrWhiteSpace(config.APIKey)) - { - // Check for legacy key config - var apiKeyFile = Path.Combine(configService.GetAppDataFolder(), "api_key.txt"); - if (File.Exists(apiKeyFile)) - { - config.APIKey = File.ReadAllText(apiKeyFile); - } - - // Check for legacy settings - - var path = Path.Combine(configService.GetAppDataFolder(), "config.json"); ; - var jsonReply = new JObject(); - if (File.Exists(path)) - { - jsonReply = JObject.Parse(File.ReadAllText(path)); - config.Port = (int)jsonReply["port"]; - config.AllowExternal = (bool)jsonReply["public"]; - } - - if (string.IsNullOrWhiteSpace(config.APIKey)) - config.APIKey = StringUtil.GenerateRandom(32); - - configService.SaveConfig(config); - } - - if (string.IsNullOrWhiteSpace(config.InstanceId)) - { - config.InstanceId = StringUtil.GenerateRandom(64); - configService.SaveConfig(config); - } - } - - public void SaveConfig() - { - configService.SaveConfig(config); - } - - public void Initalize() - { - logger.Info("Starting Jackett " + configService.GetVersion()); - CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); - // Load indexers - indexerService.InitIndexers(); - client.Init(); - } - - public void Start() - { - // Start the server - logger.Info("Starting web server at " + config.GetListenAddresses()[0]); - var startOptions = new StartOptions(); - config.GetListenAddresses().ToList().ForEach(u => startOptions.Urls.Add(u)); - _server = WebApp.Start(startOptions); - logger.Debug("Web server started"); - } - - public void ReserveUrls(bool doInstall = true) - { - logger.Debug("Unreserving Urls"); - config.GetListenAddresses(false).ToList().ForEach(u => RunNetSh(string.Format("http delete urlacl {0}", u))); - config.GetListenAddresses(true).ToList().ForEach(u => RunNetSh(string.Format("http delete urlacl {0}", u))); - if (doInstall) - { - logger.Debug("Reserving Urls"); - config.GetListenAddresses(config.AllowExternal).ToList().ForEach(u => RunNetSh(string.Format("http add urlacl {0} sddl=D:(A;;GX;;;S-1-1-0)", u))); - logger.Debug("Urls reserved"); - } - } - - private void RunNetSh(string args) - { - processService.StartProcessAndLog("netsh.exe", args); - } - - public void Stop() - { - if (_server != null) - { - _server.Dispose(); - } - } - } -} +using Autofac; +using Jackett.Models.Commands.IRC; +using Jackett.Models.Config; +using Jackett.Services; +using Jackett.Utils; +using Jackett.Utils.Clients; +using MediatR; +using Microsoft.Owin.Hosting; +using Newtonsoft.Json.Linq; +using NLog; +using NLog.Config; +using NLog.Targets; +using NLog.Windows.Forms; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.NetworkInformation; +using System.Security.Cryptography; +using System.Text; +using System.Threading.Tasks; +using System.Web; + +namespace Jackett.Services +{ + public interface IServerService + { + void Initalize(); + void Start(); + void Stop(); + void ReserveUrls(bool doInstall = true); + ServerConfig Config { get; } + void SaveConfig(); + Uri ConvertToProxyLink(Uri link, string serverUrl, string indexerId, string action = "dl", string file = "/t.torrent"); + } + + public class ServerService : IServerService + { + private ServerConfig config; + + private IDisposable _server = null; + + private IIndexerManagerService indexerService; + private IProcessService processService; + private ISerializeService serializeService; + private IConfigurationService configService; + private Logger logger; + private IWebClient client; + private IAutoDLProfileService autoDlService; + private IIRCProfileService ircProfileService; + private IIRCService ircService; + private IMediator mediator; + + public ServerService(IIndexerManagerService i, IProcessService p, ISerializeService s, IConfigurationService c, Logger l, IWebClient w, IAutoDLProfileService a, IIRCProfileService ircp, IIRCService irc, IMediator m) + { + indexerService = i; + processService = p; + serializeService = s; + configService = c; + logger = l; + client = w; + autoDlService = a; + + autoDlService.Load(); + ircProfileService = ircp; + ircService = irc; + mediator = m; + LoadConfig(); + } + + public ServerConfig Config + { + get { return config; } + } + + public Uri ConvertToProxyLink(Uri link, string serverUrl, string indexerId, string action = "dl", string file = "/t.torrent") + { + if (link == null || (link.IsAbsoluteUri && link.Scheme == "magnet")) + return link; + + var encodedLink = HttpServerUtility.UrlTokenEncode(Encoding.UTF8.GetBytes(link.ToString())) + file; + var proxyLink = string.Format("{0}{1}/{2}/{3}/{4}", serverUrl, action, indexerId, config.APIKey, encodedLink); + return new Uri(proxyLink); + } + + private void LoadConfig() + { + // Load config + config = configService.GetConfig(); + if (config == null) + { + config = new ServerConfig(); + } + + if (string.IsNullOrWhiteSpace(config.APIKey)) + { + // Check for legacy key config + var apiKeyFile = Path.Combine(configService.GetAppDataFolder(), "api_key.txt"); + if (File.Exists(apiKeyFile)) + { + config.APIKey = File.ReadAllText(apiKeyFile); + } + + // Check for legacy settings + + var path = Path.Combine(configService.GetAppDataFolder(), "config.json"); ; + var jsonReply = new JObject(); + if (File.Exists(path)) + { + jsonReply = JObject.Parse(File.ReadAllText(path)); + config.Port = (int)jsonReply["port"]; + config.AllowExternal = (bool)jsonReply["public"]; + } + + if (string.IsNullOrWhiteSpace(config.APIKey)) + config.APIKey = StringUtil.GenerateRandom(32); + + configService.SaveConfig(config); + } + + if (string.IsNullOrWhiteSpace(config.InstanceId)) + { + config.InstanceId = StringUtil.GenerateRandom(64); + configService.SaveConfig(config); + } + + ircProfileService.Load(); + + } + + public void SaveConfig() + { + configService.SaveConfig(config); + } + + public void Initalize() + { + logger.Info("Starting Jackett " + configService.GetVersion()); + CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); + // Load indexers + indexerService.InitIndexers(); + client.Init(); + } + + public void Start() + { + // Start the server + logger.Info("Starting web server at " + config.GetListenAddresses()[0]); + var startOptions = new StartOptions(); + config.GetListenAddresses().ToList().ForEach(u => startOptions.Urls.Add(u)); + _server = WebApp.Start(startOptions); + logger.Debug("Web server started"); + + foreach (var profile in ircProfileService.All) + { + ircService.CreateNetworkFromProfile(profile); + } + + mediator.Publish(new IRCMessageEvent() + { + Channel = "#tlannounces", + From = "_AnnounceBot_", + Message = "New Torrent Announcement: Name:'PokePark Pikachus Adventure REPACK USA WII-dumpTruck' uploaded by 'Anonymous' - http://www.torrentleech.org/torrent/263302", + Network = "tl", + Profile = "tl" + }); + } + + public void ReserveUrls(bool doInstall = true) + { + logger.Debug("Unreserving Urls"); + config.GetListenAddresses(false).ToList().ForEach(u => RunNetSh(string.Format("http delete urlacl {0}", u))); + config.GetListenAddresses(true).ToList().ForEach(u => RunNetSh(string.Format("http delete urlacl {0}", u))); + if (doInstall) + { + logger.Debug("Reserving Urls"); + config.GetListenAddresses(config.AllowExternal).ToList().ForEach(u => RunNetSh(string.Format("http add urlacl {0} sddl=D:(A;;GX;;;S-1-1-0)", u))); + logger.Debug("Urls reserved"); + } + } + + private void RunNetSh(string args) + { + processService.StartProcessAndLog("netsh.exe", args); + } + + public void Stop() + { + if (_server != null) + { + _server.Dispose(); + } + } + } +} diff --git a/src/Jackett/Services/SignalR/JackettHub.cs b/src/Jackett/Services/SignalR/JackettHub.cs new file mode 100644 index 000000000..29d6be544 --- /dev/null +++ b/src/Jackett/Services/SignalR/JackettHub.cs @@ -0,0 +1,43 @@ +using Autofac; +using Jackett.Models.Commands.IRC; +using MediatR; +using Microsoft.AspNet.SignalR; +using Microsoft.AspNet.SignalR.Infrastructure; +using NLog; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Services.SignalR +{ + public class JackettHub : INotificationHandler, + INotificationHandler, + INotificationHandler + { + Logger logger; + IConnectionManager manager; + + public JackettHub(Logger l, IConnectionManager m) + { + logger = l; + manager = m; + } + + public void Handle(IRCStateChangedEvent notification) + { + manager.GetHubContext().Clients.All.onEvent("IRC-State", notification); + } + + public void Handle(IRCUsersChangedEvent notification) + { + manager.GetHubContext().Clients.All.onEvent("IRC-Users", notification); + } + + public void Handle(IRCMessageEvent notification) + { + manager.GetHubContext().Clients.All.onEvent("IRC-Message", notification); + } + } +} diff --git a/src/Jackett/Services/SignalR/JackettHubProxy.cs b/src/Jackett/Services/SignalR/JackettHubProxy.cs new file mode 100644 index 000000000..b807665d4 --- /dev/null +++ b/src/Jackett/Services/SignalR/JackettHubProxy.cs @@ -0,0 +1,27 @@ +using Autofac; +using Jackett.Models.Commands.IRC; +using MediatR; +using Microsoft.AspNet.SignalR; +using NLog; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jackett.Services.SignalR +{ + + public class JackettHubProxy : Hub + { + public JackettHubProxy() + { + + } + + public override Task OnConnected() + { + return base.OnConnected(); + } + } +} diff --git a/src/Jackett/Startup.cs b/src/Jackett/Startup.cs index efa814c37..e3f438dc8 100644 --- a/src/Jackett/Startup.cs +++ b/src/Jackett/Startup.cs @@ -1,137 +1,208 @@ -using Owin; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using System.Web.Http; -using Autofac.Integration.WebApi; -using Microsoft.Owin; -using Jackett; -using Microsoft.Owin.StaticFiles; -using Microsoft.Owin.FileSystems; -using Autofac; -using Jackett.Services; -using System.Web.Http.Tracing; -using Jackett.Utils; -using Microsoft.AspNet.Identity; - -[assembly: OwinStartup(typeof(Startup))] -namespace Jackett -{ - public class Startup - { - public static bool TracingEnabled - { - get; - set; - } - - public static bool LogRequests - { - get; - set; - } - - public static string ClientOverride - { - get; - set; - } - - public static bool? DoSSLFix - { - get; - set; - } - - public void Configuration(IAppBuilder appBuilder) - { - // Configure Web API for self-host. - var config = new HttpConfiguration(); - - appBuilder.Use(); - - // Setup tracing if enabled - if (TracingEnabled) - { - config.EnableSystemDiagnosticsTracing(); - config.Services.Replace(typeof(ITraceWriter), new WebAPIToNLogTracer()); - } - // Add request logging if enabled - if (LogRequests) - { - config.MessageHandlers.Add(new WebAPIRequestLogger()); - } - config.DependencyResolver = new AutofacWebApiDependencyResolver(Engine.GetContainer()); - config.MapHttpAttributeRoutes(); - - config.Routes.MapHttpRoute( - name: "Admin", - routeTemplate: "admin/{action}", - defaults: new { controller = "Admin" } - ); - - config.Routes.MapHttpRoute( - name: "apiDefault", - routeTemplate: "api/{indexerID}", - defaults: new { controller = "Torznab", action = "Call" } - ); - - config.Routes.MapHttpRoute( - name: "api", - routeTemplate: "api/{indexerID}/api", - defaults: new { controller = "Torznab", action = "Call" } - ); - - config.Routes.MapHttpRoute( - name: "torznabDefault", - routeTemplate: "torznab/{indexerID}", - defaults: new { controller = "Torznab", action = "Call" } - ); - - config.Routes.MapHttpRoute( - name: "torznab", - routeTemplate: "torznab/{indexerID}/api", - defaults: new { controller = "Torznab", action = "Call" } - ); - - config.Routes.MapHttpRoute( - name: "potatoDefault", - routeTemplate: "potato/{indexerID}", - defaults: new { controller = "Potato", action = "Call" } - ); - - config.Routes.MapHttpRoute( - name: "potato", - routeTemplate: "potato/{indexerID}/api", - defaults: new { controller = "Potato", action = "Call" } - ); - - config.Routes.MapHttpRoute( - name: "download", - routeTemplate: "dl/{indexerID}/{apikey}/{path}/t.torrent", - defaults: new { controller = "Download", action = "Download" } - ); - - config.Routes.MapHttpRoute( - name: "blackhole", - routeTemplate: "bh/{indexerID}/{apikey}/{path}", - defaults: new { controller = "Blackhole", action = "Blackhole" } - ); - - appBuilder.UseWebApi(config); - - - appBuilder.UseFileServer(new FileServerOptions - { - RequestPath = new PathString(string.Empty), - FileSystem = new PhysicalFileSystem(Engine.ConfigService.GetContentFolder()), - EnableDirectoryBrowsing = false, - - }); - - } - } -} +using Owin; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Web.Http; +using Autofac.Integration.WebApi; +using Microsoft.Owin; +using Jackett; +using Microsoft.Owin.StaticFiles; +using Microsoft.Owin.FileSystems; +using Autofac; +using Jackett.Services; +using System.Web.Http.Tracing; +using Jackett.Utils; +using Microsoft.AspNet.Identity; +using System.IO; +using Microsoft.AspNet.SignalR; +using Autofac.Integration.SignalR; +using Swashbuckle.Application; +using Jackett.Services.SignalR; +using Microsoft.AspNet.SignalR.Infrastructure; + +[assembly: OwinStartup(typeof(Startup))] +namespace Jackett +{ + public class Startup + { + public static bool TracingEnabled + { + get; + set; + } + + public static bool LogRequests + { + get; + set; + } + + public static string ClientOverride + { + get; + set; + } + + public static bool? DoSSLFix + { + get; + set; + } + + public void Configuration(IAppBuilder appBuilder) + { + // Configure Web API for self-host. + var config = new HttpConfiguration(); + + // Use Json.NET as the serialization lib as it encodes enums as strings. + config.Formatters.JsonFormatter.SerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter()); + + + // ES6 Imports always pull from a .js file however signalr doesn't support the call with an extensions so remap it. + appBuilder.Rewrite("/signalr/hubs.js", "/signalr/hubs"); + + appBuilder.Use(); + + + // Add request logging if enabled + if (LogRequests) + { + config.MessageHandlers.Add(new WebAPIRequestLogger()); + config.EnableSystemDiagnosticsTracing(); + config.Services.Replace(typeof(ITraceWriter), new WebAPIToNLogTracer()); + } + + config.DependencyResolver = new AutofacWebApiDependencyResolver(Engine.GetContainer()); + config.MapHttpAttributeRoutes(); + appBuilder.UseWebApi(config); + + config.Routes.MapHttpRoute( + name: "autodl", + routeTemplate: "webapi/autodl", + defaults: new { controller = "AutoDL"} + ); + + config.Routes.MapHttpRoute( + name: "irccommand", + routeTemplate: "webapi/irccommand", + defaults: new { controller = "IRCChannel", action = "Command" } + ); + + config.Routes.MapHttpRoute( + name: "ircmessages", + routeTemplate: "webapi/ircmessages/{network}/{room}", + defaults: new { controller = "IRCChannel", action = "Messages", room = RouteParameter.Optional } + ); + + config.Routes.MapHttpRoute( + name: "ircusers", + routeTemplate: "webapi/ircusers/{network}/{room}", + defaults: new { controller = "IRCChannel", action = "Users" } + ); + + config.Routes.MapHttpRoute( + name: "irc", + routeTemplate: "webapi/ircstate", + defaults: new { controller = "IRCState" } + ); + + config.Routes.MapHttpRoute( + name: "webapi", + routeTemplate: "webapi/{controller}/{id}", + defaults: new { id = RouteParameter.Optional } + ); + + config.Routes.MapHttpRoute( + name: "Admin", + routeTemplate: "admin/{action}", + defaults: new { controller = "Admin" } + ); + + config.Routes.MapHttpRoute( + name: "apiDefault", + routeTemplate: "api/{indexerID}", + defaults: new { controller = "Torznab", action = "Call" } + ); + + config.Routes.MapHttpRoute( + name: "api", + routeTemplate: "api/{indexerID}/api", + defaults: new { controller = "Torznab", action = "Call" } + ); + + config.Routes.MapHttpRoute( + name: "torznabDefault", + routeTemplate: "torznab/{indexerID}", + defaults: new { controller = "Torznab", action = "Call" } + ); + + config.Routes.MapHttpRoute( + name: "torznab", + routeTemplate: "torznab/{indexerID}/api", + defaults: new { controller = "Torznab", action = "Call" } + ); + + config.Routes.MapHttpRoute( + name: "potatoDefault", + routeTemplate: "potato/{indexerID}", + defaults: new { controller = "Potato", action = "Call" } + ); + + config.Routes.MapHttpRoute( + name: "potato", + routeTemplate: "potato/{indexerID}/api", + defaults: new { controller = "Potato", action = "Call" } + ); + + config.Routes.MapHttpRoute( + name: "download", + routeTemplate: "dl/{indexerID}/{apikey}/{path}/t.torrent", + defaults: new { controller = "Download", action = "Download" } + ); + + config.Routes.MapHttpRoute( + name: "blackhole", + routeTemplate: "bh/{indexerID}/{apikey}/{path}", + defaults: new { controller = "Blackhole", action = "Blackhole" } + ); + + appBuilder.UseAutofacMiddleware(Engine.GetContainer()); + var dr = new AutofacDependencyResolver(Engine.GetContainer()); + appBuilder.MapSignalR(new Microsoft.AspNet.SignalR.HubConfiguration() + { + EnableDetailedErrors = true, + EnableJSONP = true, + Resolver = dr +}); + + appBuilder.UseFileServer(new FileServerOptions + { + RequestPath = new PathString("/dev"), + FileSystem = new PhysicalFileSystem(Path.GetFullPath(Path.Combine(Engine.ConfigService.GetContentFolder(), "../../Jackett.Web"))), + EnableDirectoryBrowsing = false, + }); + + appBuilder.UseFileServer(new FileServerOptions + { + RequestPath = new PathString(string.Empty), + FileSystem = new PhysicalFileSystem(Engine.ConfigService.GetContentFolder()), + EnableDirectoryBrowsing = false, + }); + + config + .EnableSwagger(c => c.SingleApiVersion("v1", "Jackett API")) + .EnableSwaggerUi("docs/{*assetPath}"); + + var conManager = dr.Resolve(); + var builder = new ContainerBuilder(); + builder.RegisterInstance(conManager).As(); + builder.Update(Engine.GetContainer()); + + // IHubContext hubContext = dr.Resolve().GetHubContext(); + // var context = GlobalHost.ConnectionManager.GetHubContext(); + } + } +} diff --git a/src/Jackett/autodl-trackers b/src/Jackett/autodl-trackers new file mode 160000 index 000000000..c48c935bf --- /dev/null +++ b/src/Jackett/autodl-trackers @@ -0,0 +1 @@ +Subproject commit c48c935bf3087ea2c3c18c76c3ac9679d6b383c4 diff --git a/src/Jackett/packages.config b/src/Jackett/packages.config index b602742aa..862a0264c 100644 --- a/src/Jackett/packages.config +++ b/src/Jackett/packages.config @@ -1,29 +1,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Website/Web.config b/src/Website/Web.config index f150b78f1..1063a1fbe 100644 --- a/src/Website/Web.config +++ b/src/Website/Web.config @@ -1,108 +1,108 @@ - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Website/Website.csproj b/src/Website/Website.csproj index 0a14a684e..77f51a5d0 100644 --- a/src/Website/Website.csproj +++ b/src/Website/Website.csproj @@ -1,423 +1,423 @@ - - - - - - - Debug - AnyCPU - - - 2.0 - {6B6AB1B0-5ABD-4696-A3D2-70E991174625} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Website - Website - v4.5 - false - true - - - - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - ..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll - True - - - ..\packages\CommonMark.NET.0.9.1\lib\net45\CommonMark.dll - True - - - ..\packages\LiteDB.1.0.2\lib\net40\LiteDB.dll - True - - - ..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll - True - - - ..\packages\Microsoft.AspNet.Identity.Owin.2.2.1\lib\net45\Microsoft.AspNet.Identity.Owin.dll - True - - - ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll - True - - - - ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll - True - - - ..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll - True - - - ..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll - True - - - ..\packages\Microsoft.Owin.Security.Cookies.3.0.1\lib\net45\Microsoft.Owin.Security.Cookies.dll - True - - - ..\packages\Microsoft.Owin.Security.Facebook.3.0.1\lib\net45\Microsoft.Owin.Security.Facebook.dll - True - - - ..\packages\Microsoft.Owin.Security.Google.3.0.1\lib\net45\Microsoft.Owin.Security.Google.dll - True - - - ..\packages\Microsoft.Owin.Security.MicrosoftAccount.3.0.1\lib\net45\Microsoft.Owin.Security.MicrosoftAccount.dll - True - - - ..\packages\Microsoft.Owin.Security.OAuth.3.0.1\lib\net45\Microsoft.Owin.Security.OAuth.dll - True - - - ..\packages\Microsoft.Owin.Security.Twitter.3.0.1\lib\net45\Microsoft.Owin.Security.Twitter.dll - True - - - ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - True - - - ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll - True - - - ..\packages\Octokit.0.14.0\lib\net45\Octokit.dll - True - - - ..\packages\Owin.1.0\lib\net40\Owin.dll - True - - - - - - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - True - - - - - - - - - - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - True - - - ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll - True - - - ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll - True - - - ..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll - True - - - ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll - True - - - - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll - True - - - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll - True - - - ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll - True - - - - - - - - - - - - ..\packages\WebGrease.1.6.0\lib\WebGrease.dll - True - - - - - - - - - - - - - Global.asax - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - PreserveNewest - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - Web.config - - - Web.config - - - - - - - - - - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - - - - True - True - 54981 - / - http://localhost:54981/ - False - False - - - False - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + + + + + + + Debug + AnyCPU + + + 2.0 + {6B6AB1B0-5ABD-4696-A3D2-70E991174625} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Website + Website + v4.5 + false + true + + + + + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + ..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll + True + + + ..\packages\CommonMark.NET.0.9.1\lib\net45\CommonMark.dll + True + + + ..\packages\LiteDB.1.0.2\lib\net40\LiteDB.dll + True + + + ..\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll + True + + + ..\packages\Microsoft.AspNet.Identity.Owin.2.2.1\lib\net45\Microsoft.AspNet.Identity.Owin.dll + True + + + ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll + True + + + + ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll + True + + + ..\packages\Microsoft.Owin.Host.SystemWeb.3.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll + True + + + ..\packages\Microsoft.Owin.Security.3.0.1\lib\net45\Microsoft.Owin.Security.dll + True + + + ..\packages\Microsoft.Owin.Security.Cookies.3.0.1\lib\net45\Microsoft.Owin.Security.Cookies.dll + True + + + ..\packages\Microsoft.Owin.Security.Facebook.3.0.1\lib\net45\Microsoft.Owin.Security.Facebook.dll + True + + + ..\packages\Microsoft.Owin.Security.Google.3.0.1\lib\net45\Microsoft.Owin.Security.Google.dll + True + + + ..\packages\Microsoft.Owin.Security.MicrosoftAccount.3.0.1\lib\net45\Microsoft.Owin.Security.MicrosoftAccount.dll + True + + + ..\packages\Microsoft.Owin.Security.OAuth.3.0.1\lib\net45\Microsoft.Owin.Security.OAuth.dll + True + + + ..\packages\Microsoft.Owin.Security.Twitter.3.0.1\lib\net45\Microsoft.Owin.Security.Twitter.dll + True + + + ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + True + + + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll + True + + + ..\packages\Octokit.0.14.0\lib\net45\Octokit.dll + True + + + ..\packages\Owin.1.0\lib\net40\Owin.dll + True + + + + + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + + + + + + + + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + True + + + ..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll + True + + + ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll + True + + + ..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll + True + + + ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll + True + + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll + True + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll + True + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll + True + + + + + + + + + + + + ..\packages\WebGrease.1.6.0\lib\WebGrease.dll + True + + + + + + + + + + + + + Global.asax + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + PreserveNewest + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + Web.config + + + Web.config + + + + + + + + + + + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + + + + True + True + 54981 + / + http://localhost:54981/ + False + False + + + False + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + --> \ No newline at end of file diff --git a/src/Website/packages.config b/src/Website/packages.config index 92b6ef170..311fbb01d 100644 --- a/src/Website/packages.config +++ b/src/Website/packages.config @@ -1,37 +1,37 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file