diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100755 index 00000000..77f1912f --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,19 @@ +init: +- git config --global core.autocrlf true +install: +- ps: Install-Product node 6.9.2 x64 +branches: + only: + - master + - /^release\/.*$/ + - /^(.*\/)?ci-.*$/ +build_script: +- ps: .\run.ps1 default-build +clone_depth: 1 +environment: + global: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: 1 +test: 'off' +deploy: 'off' +os: Visual Studio 2017 diff --git a/.gitignore b/.gitignore index 62ebab8f..79812ddb 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ PublishProfiles/ *.docstates _ReSharper.* nuget.exe -project.lock.json *net45.csproj *net451.csproj *k10.csproj @@ -25,14 +24,8 @@ project.lock.json *.ncrunchsolution *.*sdf *.ipch - .vs/ npm-debug.log /.build/ - -# The templates can't contain their own .gitignore files, because Yeoman has strange default handling for -# files with that name (https://github.com/npm/npm/issues/1862). So, each template instead has a template_gitignore -# file which gets renamed after the files are copied. And so any files that need to be excluded in the source -# repo have to be excluded here. -/templates/*/node_modules/ -/templates/*/wwwroot/dist/ +.vscode/ +global.json diff --git a/.travis.yml b/.travis.yml index d2d8dfdd..d974c566 100755 --- a/.travis.yml +++ b/.travis.yml @@ -10,11 +10,15 @@ addons: - libssl-dev - libunwind8 - zlib1g -mono: - - 4.0.5 +mono: none os: - - linux - - osx +- linux +- osx osx_image: xcode7.1 script: - - ./build.sh verify +- ./build.sh +branches: + only: + - master + - /^release\/.*$/ + - /^(.*\/)?ci-.*$/ diff --git a/.vsts-pipelines/builds/ci-internal.yml b/.vsts-pipelines/builds/ci-internal.yml new file mode 100644 index 00000000..c2c5336f --- /dev/null +++ b/.vsts-pipelines/builds/ci-internal.yml @@ -0,0 +1,13 @@ +trigger: +- master +- release/* + +resources: + repositories: + - repository: buildtools + type: git + name: aspnet-BuildTools + ref: refs/heads/master + +phases: +- template: .vsts-pipelines/templates/project-ci.yml@buildtools diff --git a/.vsts-pipelines/builds/ci-public.yml b/.vsts-pipelines/builds/ci-public.yml new file mode 100644 index 00000000..507c89b0 --- /dev/null +++ b/.vsts-pipelines/builds/ci-public.yml @@ -0,0 +1,15 @@ +trigger: +- master +- release/* + +# See https://github.com/aspnet/BuildTools +resources: + repositories: + - repository: buildtools + type: github + endpoint: DotNet-Bot GitHub Connection + name: aspnet/BuildTools + ref: refs/heads/master + +phases: +- template: .vsts-pipelines/templates/project-ci.yml@buildtools diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 64ff041d..eac4268e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ Contributing ====== -Information on contributing to this repo is in the [Contributing Guide](https://github.com/aspnet/Home/blob/dev/CONTRIBUTING.md) in the Home repo. +Information on contributing to this repo is in the [Contributing Guide](https://github.com/aspnet/Home/blob/master/CONTRIBUTING.md) in the Home repo. diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..cec8e3da --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,15 @@ + + + + + + + Microsoft ASP.NET Core + https://github.com/aspnet/javascriptservices + git + $(MSBuildThisFileDirectory) + $(MSBuildThisFileDirectory)build\Key.snk + true + true + + diff --git a/Directory.Build.targets b/Directory.Build.targets new file mode 100644 index 00000000..7e3f8df9 --- /dev/null +++ b/Directory.Build.targets @@ -0,0 +1,6 @@ + + + $(MicrosoftNETCoreAppPackageVersion) + $(NETStandardLibrary20PackageVersion) + + diff --git a/JavaScriptServices.sln b/JavaScriptServices.sln index 55338882..f01aa1a9 100644 --- a/JavaScriptServices.sln +++ b/JavaScriptServices.sln @@ -1,50 +1,43 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25123.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{E6E88944-4800-40BA-8AF5-069EA3ADFEB8}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.NodeServices", "src\Microsoft.AspNetCore.NodeServices\Microsoft.AspNetCore.NodeServices.xproj", "{B0FA4175-8B29-4904-9780-28B3C24B0567}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NodeServicesExamples", "samples\misc\NodeServicesExamples\NodeServicesExamples.xproj", "{6D4BCDD6-7951-449B-BE55-CB7F014B7430}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{78DAC76C-1092-45AB-BF0D-594B8C7B6569}" +# Visual Studio 15 +VisualStudioVersion = 15.0.26730.16 +MinimumVisualStudioVersion = 15.0.26730.03 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{27304DDE-AFB2-4F8B-B765-E3E2F11E886C}" ProjectSection(SolutionItems) = preProject - global.json = global.json + src\Directory.Build.props = src\Directory.Build.props EndProjectSection EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MusicStore", "samples\angular\MusicStore\MusicStore.xproj", "{1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ReactGrid", "samples\react\ReactGrid\ReactGrid.xproj", "{ABF90A5B-F4E0-438C-A6E4-9549FB43690B}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.AngularServices", "src\Microsoft.AspNetCore.AngularServices\Microsoft.AspNetCore.AngularServices.xproj", "{421807E6-B62C-417B-B901-46C5DEDAA8F1}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.ReactServices", "src\Microsoft.AspNetCore.ReactServices\Microsoft.AspNetCore.ReactServices.xproj", "{B04381DE-991F-4831-A0B5-FE1BD3EF80C4}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.SpaServices", "src\Microsoft.AspNetCore.SpaServices\Microsoft.AspNetCore.SpaServices.xproj", "{4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.NodeServices", "src\Microsoft.AspNetCore.NodeServices\Microsoft.AspNetCore.NodeServices.csproj", "{66B77203-1469-41DF-92F2-2BE6900BD36F}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{727E6D58-6830-4792-96C6-E138A33959FB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.NodeServices.Sockets", "src\Microsoft.AspNetCore.NodeServices.Sockets\Microsoft.AspNetCore.NodeServices.Sockets.csproj", "{F46DEF99-6FAA-4406-B5D8-6FF34EF669E3}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Angular2Spa", "templates\Angular2Spa\Angular2Spa.xproj", "{8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices", "src\Microsoft.AspNetCore.SpaServices\Microsoft.AspNetCore.SpaServices.csproj", "{66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ReactReduxSpa", "templates\ReactReduxSpa\ReactReduxSpa.xproj", "{DBFC6DB0-A6D1-4694-A108-1C604B988DA3}" -EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ReactSpa", "templates\ReactSpa\ReactSpa.xproj", "{E9D1A695-F0E6-46F2-B5E3-72F4AF805387}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{99EAF1FE-22C8-4526-BE78-74B24125D37F}" + ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + global.json = global.json + README.md = README.md + EndProjectSection EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApplicationBasic", "templates\WebApplicationBasic\WebApplicationBasic.xproj", "{CB4398D6-B7F1-449A-AE02-828769679232}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{23836492-E7F4-4376-85BF-A635C304AC46}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{E0771531-BE20-40CD-A1B0-A57E09511060}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{E6A161EA-646C-4033-9090-95BE809AB8D9}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Webpack", "samples\misc\Webpack\Webpack.xproj", "{A8905301-8492-42FD-9E83-F715A0FDC3A2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LatencyTest", "samples\misc\LatencyTest\LatencyTest.csproj", "{1931B19A-EC42-4D56-B2D0-FB06D17244DA}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "LatencyTest", "samples\misc\LatencyTest\LatencyTest.xproj", "{A64AF9D9-72AA-4433-BE1D-DC2524B6808A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Webpack", "samples\misc\Webpack\Webpack.csproj", "{DE479DC3-1461-4EAD-A188-4AF7AA4AE344}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "React", "React", "{E0EBA813-4478-4C02-B11D-FB3793113FE4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NodeServicesExamples", "samples\misc\NodeServicesExamples\NodeServicesExamples.csproj", "{93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "MusicStore", "samples\react\MusicStore\MusicStore.xproj", "{C870A92C-9E3F-4BF2-82B8-5758545A8B7C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{645F7363-1240-4FB6-9422-B32A327C979F}" + ProjectSection(SolutionItems) = preProject + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets + EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Angular", "Angular", "{4867A616-83D6-48DC-964D-6AE743596631}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.SpaServices.Extensions", "src\Microsoft.AspNetCore.SpaServices.Extensions\Microsoft.AspNetCore.SpaServices.Extensions.csproj", "{D40BD1C4-6A6F-4213-8535-1057F3EB3400}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -52,79 +45,49 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B0FA4175-8B29-4904-9780-28B3C24B0567}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B0FA4175-8B29-4904-9780-28B3C24B0567}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B0FA4175-8B29-4904-9780-28B3C24B0567}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B0FA4175-8B29-4904-9780-28B3C24B0567}.Release|Any CPU.Build.0 = Release|Any CPU - {6D4BCDD6-7951-449B-BE55-CB7F014B7430}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6D4BCDD6-7951-449B-BE55-CB7F014B7430}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6D4BCDD6-7951-449B-BE55-CB7F014B7430}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6D4BCDD6-7951-449B-BE55-CB7F014B7430}.Release|Any CPU.Build.0 = Release|Any CPU - {1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B}.Release|Any CPU.Build.0 = Release|Any CPU - {ABF90A5B-F4E0-438C-A6E4-9549FB43690B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ABF90A5B-F4E0-438C-A6E4-9549FB43690B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ABF90A5B-F4E0-438C-A6E4-9549FB43690B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ABF90A5B-F4E0-438C-A6E4-9549FB43690B}.Release|Any CPU.Build.0 = Release|Any CPU - {421807E6-B62C-417B-B901-46C5DEDAA8F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {421807E6-B62C-417B-B901-46C5DEDAA8F1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {421807E6-B62C-417B-B901-46C5DEDAA8F1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {421807E6-B62C-417B-B901-46C5DEDAA8F1}.Release|Any CPU.Build.0 = Release|Any CPU - {B04381DE-991F-4831-A0B5-FE1BD3EF80C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B04381DE-991F-4831-A0B5-FE1BD3EF80C4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B04381DE-991F-4831-A0B5-FE1BD3EF80C4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B04381DE-991F-4831-A0B5-FE1BD3EF80C4}.Release|Any CPU.Build.0 = Release|Any CPU - {4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4624F728-6DFF-44B6-93B5-3C7D9C94BF3F}.Release|Any CPU.Build.0 = Release|Any CPU - {8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11}.Release|Any CPU.Build.0 = Release|Any CPU - {DBFC6DB0-A6D1-4694-A108-1C604B988DA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DBFC6DB0-A6D1-4694-A108-1C604B988DA3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DBFC6DB0-A6D1-4694-A108-1C604B988DA3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DBFC6DB0-A6D1-4694-A108-1C604B988DA3}.Release|Any CPU.Build.0 = Release|Any CPU - {E9D1A695-F0E6-46F2-B5E3-72F4AF805387}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E9D1A695-F0E6-46F2-B5E3-72F4AF805387}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E9D1A695-F0E6-46F2-B5E3-72F4AF805387}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E9D1A695-F0E6-46F2-B5E3-72F4AF805387}.Release|Any CPU.Build.0 = Release|Any CPU - {CB4398D6-B7F1-449A-AE02-828769679232}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CB4398D6-B7F1-449A-AE02-828769679232}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CB4398D6-B7F1-449A-AE02-828769679232}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CB4398D6-B7F1-449A-AE02-828769679232}.Release|Any CPU.Build.0 = Release|Any CPU - {A8905301-8492-42FD-9E83-F715A0FDC3A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A8905301-8492-42FD-9E83-F715A0FDC3A2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A8905301-8492-42FD-9E83-F715A0FDC3A2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A8905301-8492-42FD-9E83-F715A0FDC3A2}.Release|Any CPU.Build.0 = Release|Any CPU - {A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A64AF9D9-72AA-4433-BE1D-DC2524B6808A}.Release|Any CPU.Build.0 = Release|Any CPU - {C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C870A92C-9E3F-4BF2-82B8-5758545A8B7C}.Release|Any CPU.Build.0 = Release|Any CPU + {66B77203-1469-41DF-92F2-2BE6900BD36F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66B77203-1469-41DF-92F2-2BE6900BD36F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66B77203-1469-41DF-92F2-2BE6900BD36F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66B77203-1469-41DF-92F2-2BE6900BD36F}.Release|Any CPU.Build.0 = Release|Any CPU + {F46DEF99-6FAA-4406-B5D8-6FF34EF669E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F46DEF99-6FAA-4406-B5D8-6FF34EF669E3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F46DEF99-6FAA-4406-B5D8-6FF34EF669E3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F46DEF99-6FAA-4406-B5D8-6FF34EF669E3}.Release|Any CPU.Build.0 = Release|Any CPU + {66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66B071A8-EFC8-4A06-BEF6-06B99AE27EEC}.Release|Any CPU.Build.0 = Release|Any CPU + {1931B19A-EC42-4D56-B2D0-FB06D17244DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1931B19A-EC42-4D56-B2D0-FB06D17244DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1931B19A-EC42-4D56-B2D0-FB06D17244DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1931B19A-EC42-4D56-B2D0-FB06D17244DA}.Release|Any CPU.Build.0 = Release|Any CPU + {DE479DC3-1461-4EAD-A188-4AF7AA4AE344}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DE479DC3-1461-4EAD-A188-4AF7AA4AE344}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DE479DC3-1461-4EAD-A188-4AF7AA4AE344}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DE479DC3-1461-4EAD-A188-4AF7AA4AE344}.Release|Any CPU.Build.0 = Release|Any CPU + {93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {93EFCC5F-C6EE-4623-894F-A42B22C0B6FE}.Release|Any CPU.Build.0 = Release|Any CPU + {D40BD1C4-6A6F-4213-8535-1057F3EB3400}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D40BD1C4-6A6F-4213-8535-1057F3EB3400}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D40BD1C4-6A6F-4213-8535-1057F3EB3400}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D40BD1C4-6A6F-4213-8535-1057F3EB3400}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {6D4BCDD6-7951-449B-BE55-CB7F014B7430} = {E0771531-BE20-40CD-A1B0-A57E09511060} - {1A74148F-9DC0-435D-B5AC-7D1B0D3D5E0B} = {4867A616-83D6-48DC-964D-6AE743596631} - {ABF90A5B-F4E0-438C-A6E4-9549FB43690B} = {E0EBA813-4478-4C02-B11D-FB3793113FE4} - {8F5CB8A9-3086-4B49-A1C2-32A9F89BCA11} = {727E6D58-6830-4792-96C6-E138A33959FB} - {DBFC6DB0-A6D1-4694-A108-1C604B988DA3} = {727E6D58-6830-4792-96C6-E138A33959FB} - {E9D1A695-F0E6-46F2-B5E3-72F4AF805387} = {727E6D58-6830-4792-96C6-E138A33959FB} - {CB4398D6-B7F1-449A-AE02-828769679232} = {727E6D58-6830-4792-96C6-E138A33959FB} - {E0771531-BE20-40CD-A1B0-A57E09511060} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8} - {A8905301-8492-42FD-9E83-F715A0FDC3A2} = {E0771531-BE20-40CD-A1B0-A57E09511060} - {A64AF9D9-72AA-4433-BE1D-DC2524B6808A} = {E0771531-BE20-40CD-A1B0-A57E09511060} - {E0EBA813-4478-4C02-B11D-FB3793113FE4} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8} - {C870A92C-9E3F-4BF2-82B8-5758545A8B7C} = {E0EBA813-4478-4C02-B11D-FB3793113FE4} - {4867A616-83D6-48DC-964D-6AE743596631} = {E6E88944-4800-40BA-8AF5-069EA3ADFEB8} + {66B77203-1469-41DF-92F2-2BE6900BD36F} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C} + {F46DEF99-6FAA-4406-B5D8-6FF34EF669E3} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C} + {66B071A8-EFC8-4A06-BEF6-06B99AE27EEC} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C} + {E6A161EA-646C-4033-9090-95BE809AB8D9} = {23836492-E7F4-4376-85BF-A635C304AC46} + {1931B19A-EC42-4D56-B2D0-FB06D17244DA} = {E6A161EA-646C-4033-9090-95BE809AB8D9} + {DE479DC3-1461-4EAD-A188-4AF7AA4AE344} = {E6A161EA-646C-4033-9090-95BE809AB8D9} + {93EFCC5F-C6EE-4623-894F-A42B22C0B6FE} = {E6A161EA-646C-4033-9090-95BE809AB8D9} + {D40BD1C4-6A6F-4213-8535-1057F3EB3400} = {27304DDE-AFB2-4F8B-B765-E3E2F11E886C} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DDF59B0D-2DEC-45D6-8667-DCB767487101} EndGlobalSection EndGlobal diff --git a/LICENSE.txt b/LICENSE.txt index 0bdc1962..b3b180cd 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,12 +1,201 @@ -Copyright (c) .NET Foundation. All rights reserved. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -these files except in compliance with the License. You may obtain a copy of the -License at + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -http://www.apache.org/licenses/LICENSE-2.0 + 1. Definitions. -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. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) .NET Foundation and Contributors + + 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. diff --git a/NuGet.config b/NuGet.config new file mode 100644 index 00000000..e32bddfd --- /dev/null +++ b/NuGet.config @@ -0,0 +1,7 @@ + + + + + + + diff --git a/NuGet.master.config b/NuGet.master.config deleted file mode 100755 index 1ff3c9aa..00000000 --- a/NuGet.master.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json new file mode 100644 index 00000000..22ef3c09 --- /dev/null +++ b/NuGetPackageVerifier.json @@ -0,0 +1,7 @@ +{ + "Default": { + "rules": [ + "DefaultCompositeRule" + ] + } +} diff --git a/README.md b/README.md index ed2f172c..dfa67285 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,61 @@ -# JavaScriptServices +# JavaScriptServices [Archived] + +## IMPORTANT + +The features described in this article are obsolete as of ASP.NET Core 3.0. A simpler SPA frameworks integration mechanism is available in the [Microsoft.AspNetCore.SpaServices.Extensions](https://www.nuget.org/packages/Microsoft.AspNetCore.SpaServices.Extensions) NuGet package. For more information, see [[Announcement] Obsoleting Microsoft.AspNetCore.SpaServices and Microsoft.AspNetCore.NodeServices](https://github.com/dotnet/AspNetCore/issues/12890). -This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. ## What is this? -`JavaScriptServices` is a set of technologies for ASP.NET Core developers. It provides infrastructure that you'll find useful if you use Angular 2 / React / Knockout / etc. on the client, or if you build your client-side resources using Webpack, or otherwise want to execute JavaScript on the server at runtime. +`JavaScriptServices` is a set of client-side technologies for ASP.NET Core. It provides infrastructure that you'll find useful if you: + +- Use Angular / React / Vue / Aurelia / Knockout / etc. +- Build your client-side resources using Webpack. +- Execute JavaScript on the server at runtime. + +Read [Building Single Page Applications on ASP.NET Core with JavaScriptServices](https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/) for more details. This repo contains: * A set of NuGet/NPM packages that implement functionality for: - * Invoking arbitrary NPM packages at runtime from .NET code ([docs](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.NodeServices#simple-usage-example)) - * Server-side prerendering of SPA components ([docs](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.SpaServices#server-side-prerendering)) - * Webpack dev middleware ([docs](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.SpaServices#webpack-dev-middleware)) - * Hot module replacement (HMR) ([docs](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.SpaServices#webpack-hot-module-replacement)) - * Server-side and client-side routing integration ([docs](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.SpaServices#routing-helper-mapspafallbackroute)) + * Invoking arbitrary NPM packages at runtime from .NET code ([docs](/src/Microsoft.AspNetCore.NodeServices#simple-usage-example)) + * Server-side prerendering of SPA components ([docs](/src/Microsoft.AspNetCore.SpaServices#server-side-prerendering)) + * Webpack dev middleware ([docs](/src/Microsoft.AspNetCore.SpaServices#webpack-dev-middleware)) + * Hot module replacement (HMR) ([docs](/src/Microsoft.AspNetCore.SpaServices#webpack-hot-module-replacement)) + * Server-side and client-side routing integration ([docs](/src/Microsoft.AspNetCore.SpaServices#routing-helper-mapspafallbackroute)) * Server-side and client-side validation integration - * "Cache priming" for Angular 2 apps * "Lazy loading" for Knockout apps - * A Yeoman generator that creates preconfigured app starting points ([guide](http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/)) * Samples and docs -Everything here is cross-platform, and works with .NET Core 1.0 RC2 or later on Windows, Linux, or OS X. +It's cross-platform (Windows, Linux, or macOS) and works with .NET Core 2.0 or later. ## Creating new applications -If you want to build a brand-new ASP.NET Core app that uses Angular 2 / React / Knockout on the client, consider starting with the `aspnetcore-spa` generator. This lets you choose your client-side framework, and generates a starting point that includes applicable features such as Webpack dev middleware, server-side prerendering, and efficient production builds. +Prerequisites: + +* [.NET Core 2.0](https://www.microsoft.com/net/core) (or later) SDK +* [Node.js](https://nodejs.org/) version 6 (or later) + +With these prerequisites, you can immediately create new ASP.NET Core applications that use Angular, React, or React+Redux without having to install anything extra. + +### Option 1: Creating Angular/React/Redux applications from the command line (cross-platform) + +In an empty directory, run (for example) `dotnet new angular`. Other supported SPA frameworks include React and React+Redux. You can see the list of available SPA templates by running `dotnet new spa`. + +Once the generator has run and restored all the dependencies, you can start up your new ASP.NET Core SPA: -See: [getting started with the `aspnetcore-spa` generator](http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/). It's much easier than configuring everything to work together manually! + npm install + dotnet run +### Option 2: Creating Angular/React/Redux applications using Visual Studio 2017 Update 3 or later (Windows only) + +Using the `File`->`New Project` dialog, select *ASP.NET Core Web Application*. You will then be offered the option to create an application with Angular, React, or React+Redux. When the application is created, you can build and run it in the normal way. + +### More info and other SPA frameworks + +For a more detailed (albeit somewhat outdated) walkthrough, see [getting started with the `aspnetcore-spa` generator](http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/). + +If you want to build an ASP.NET Core application with Aurelia, Knockout, or Vue, you can use the `Microsoft.AspNetCore.SpaTemplates` package. On the command line, run `dotnet new --install Microsoft.AspNetCore.SpaTemplates`. Then you will be able to run `dotnet new aurelia` (or `dotnet new vue`, etc.) to create your new application. ## Adding to existing applications @@ -36,40 +64,28 @@ If you have an existing ASP.NET Core application, or if you just want to use the * `Microsoft.AspNetCore.NodeServices` * This provides a fast and robust way for .NET code to run JavaScript on the server inside a Node.js environment. You can use this to consume arbitrary functionality from NPM packages at runtime in your ASP.NET Core app. * Most applications developers don't need to use this directly, but you can do so if you want to implement your own functionality that involves calling Node.js code from .NET at runtime. - * Find [documentation and usage examples here](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.NodeServices#microsoftaspnetcorenodeservices). + * Find [documentation and usage examples here](/src/Microsoft.AspNetCore.NodeServices#microsoftaspnetcorenodeservices). * `Microsoft.AspNetCore.SpaServices` - * This provides infrastructure that's generally useful when building Single Page Applications (SPAs) with technologies such as Angular 2 or React (for example, server-side prerendering and webpack middleware). Internally, it uses the `NodeServices` package to implement its features. - * Find [documentation and usage examples here](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.SpaServices#microsoftaspnetcorespaservices). - * `Microsoft.AspNetCore.AngularServices` - * This builds on the `SpaServices` package and includes features specific to Angular 2. Currently, this includes validation helpers and a "cache priming" feature, which let you pre-evaluate ajax requests on the server so that client-side code doesn't need to make network calls once it's loaded. - * The code is [here](https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.AngularServices), and you'll find a usage example for [the validation helper here](https://github.com/aspnet/JavaScriptServices/blob/dev/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-edit/album-edit.ts), and for the [cache priming here](https://github.com/aspnet/JavaScriptServices/blob/dev/samples/angular/MusicStore/Views/Home/Index.cshtml#L7-8). Full docs are to be written. + * This provides infrastructure that's generally useful when building Single Page Applications (SPAs) with technologies such as Angular or React (for example, server-side prerendering and webpack middleware). Internally, it uses the `NodeServices` package to implement its features. + * Find [documentation and usage examples here](/src/Microsoft.AspNetCore.SpaServices#microsoftaspnetcorespaservices) -There was previously a `Microsoft.AspNetCore.ReactServices` but this is not currently needed - all applicable functionality is in `Microsoft.AspNetCore.SpaServices`, because it's sufficiently general. We might add a new `Microsoft.AspNetCore.ReactServices` package in the future if new React-specific requirements emerge. +There were previously other packages called `Microsoft.AspNetCore.AngularServices` and `Microsoft.AspNetCore.ReactServices` but these are not currently needed - all applicable functionality is in `Microsoft.AspNetCore.SpaServices`, because it's sufficiently general. If you want to build a helper library for some other SPA framework, you can do so by taking a dependency on `Microsoft.AspNetCore.SpaServices` and wrapping its functionality in whatever way is most useful for your SPA framework. -## Samples and templates +## Samples -Inside this repo, [the `templates` directory](https://github.com/aspnet/JavaScriptServices/tree/dev/templates) contains the application starting points that the `aspnetcore-spa` generator emits. If you want, you can clone this repo and run those applications directly. But it's easier to [use the Yeoman tool to run the generator](http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/). +The [`samples` directory](/samples) contains examples of: -Also in this repo, [the `samples` directory](https://github.com/aspnet/JavaScriptServices/tree/dev/samples) contains examples of using the JavaScript services family of packages with Angular 2 and React, plus examples of standalone `NodeServices` usage for runtime code transpilation and image processing. +- Using the JavaScript services family of packages with Angular and React. +- A standalone `NodeServices` usage for runtime code transpilation and image processing. **To run the samples:** * Clone this repo - * Change directory to the same you want to run (e.g., `cd samples/angular/MusicStore`) - * Restore dependencies (run `dotnet restore` and `npm install`) + * At the repo's root directory (the one containing `src`, `samples`, etc.), run `dotnet restore` + * Change directory to the sample you want to run (for example, `cd samples/angular/MusicStore`) + * Restore Node dependencies by running `npm install` + * If you're trying to run the Angular "Music Store" sample, then also run `gulp` (which you need to have installed globally). None of the other samples require this. * Run the application (`dotnet run`) * Browse to [http://localhost:5000](http://localhost:5000) - -## Contributing - -If you're interested in contributing to the various packages, samples, and project templates in this repo, that's great! You can run the code in this repo just by: - - * Cloning the repo - * Running `dotnet restore` at the repo root dir - * Going to whatever sample or template you want to run (e.g., `cd templates/Angular2Spa`) - * Restoring NPM dependencies (run `npm install`) - * Launching it (`dotnet run`) - -If you're planning to submit a pull request, and if it's more than a trivial fix (e.g., for a typo), it's usually a good idea first to file an issue describing what you're proposing to do and how it will work. Then you can find out if it's likely that such a pull request will be accepted, and how it fits into wider ongoing plans. diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100755 index eb246166..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,7 +0,0 @@ -init: - - git config --global core.autocrlf true -build_script: - - build.cmd verify -clone_depth: 1 -test: off -deploy: off diff --git a/build.cmd b/build.cmd index 7d4894cb..c0050bda 100755 --- a/build.cmd +++ b/build.cmd @@ -1,2 +1,2 @@ @ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE" \ No newline at end of file +PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' default-build %*; exit $LASTEXITCODE" diff --git a/build.ps1 b/build.ps1 deleted file mode 100644 index 8f2f9969..00000000 --- a/build.ps1 +++ /dev/null @@ -1,67 +0,0 @@ -$ErrorActionPreference = "Stop" - -function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries) -{ - while($true) - { - try - { - Invoke-WebRequest $url -OutFile $downloadLocation - break - } - catch - { - $exceptionMessage = $_.Exception.Message - Write-Host "Failed to download '$url': $exceptionMessage" - if ($retries -gt 0) { - $retries-- - Write-Host "Waiting 10 seconds before retrying. Retries left: $retries" - Start-Sleep -Seconds 10 - - } - else - { - $exception = $_.Exception - throw $exception - } - } - } -} - -cd $PSScriptRoot - -$repoFolder = $PSScriptRoot -$env:REPO_FOLDER = $repoFolder - -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" -if ($env:KOREBUILD_ZIP) -{ - $koreBuildZip=$env:KOREBUILD_ZIP -} - -$buildFolder = ".build" -$buildFile="$buildFolder\KoreBuild.ps1" - -if (!(Test-Path $buildFolder)) { - Write-Host "Downloading KoreBuild from $koreBuildZip" - - $tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid() - New-Item -Path "$tempFolder" -Type directory | Out-Null - - $localZipFile="$tempFolder\korebuild.zip" - - DownloadWithRetry -url $koreBuildZip -downloadLocation $localZipFile -retries 6 - - Add-Type -AssemblyName System.IO.Compression.FileSystem - [System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder) - - New-Item -Path "$buildFolder" -Type directory | Out-Null - copy-item "$tempFolder\**\build\*" $buildFolder -Recurse - - # Cleanup - if (Test-Path $tempFolder) { - Remove-Item -Recurse -Force $tempFolder - } -} - -&"$buildFile" $args \ No newline at end of file diff --git a/build.sh b/build.sh index f4208100..98a4b227 100755 --- a/build.sh +++ b/build.sh @@ -1,46 +1,8 @@ #!/usr/bin/env bash -repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" -if [ ! -z $KOREBUILD_ZIP ]; then - koreBuildZip=$KOREBUILD_ZIP -fi +set -euo pipefail +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -buildFolder=".build" -buildFile="$buildFolder/KoreBuild.sh" - -if test ! -d $buildFolder; then - echo "Downloading KoreBuild from $koreBuildZip" - - tempFolder="/tmp/KoreBuild-$(uuidgen)" - mkdir $tempFolder - - localZipFile="$tempFolder/korebuild.zip" - - retries=6 - until (wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip 2>/dev/null) - do - echo "Failed to download '$koreBuildZip'" - if [ "$retries" -le 0 ]; then - exit 1 - fi - retries=$((retries - 1)) - echo "Waiting 10 seconds before retrying. Retries left: $retries" - sleep 10s - done - - unzip -q -d $tempFolder $localZipFile - - mkdir $buildFolder - cp -r $tempFolder/**/build/** $buildFolder - - chmod +x $buildFile - - # Cleanup - if test ! -d $tempFolder; then - rm -rf $tempFolder - fi -fi - -$buildFile -r $repoFolder "$@" \ No newline at end of file +# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs) +chmod +x "$DIR/run.sh"; sync +"$DIR/run.sh" default-build "$@" diff --git a/tools/Key.snk b/build/Key.snk similarity index 100% rename from tools/Key.snk rename to build/Key.snk diff --git a/build/dependencies.props b/build/dependencies.props new file mode 100644 index 00000000..40e13eba --- /dev/null +++ b/build/dependencies.props @@ -0,0 +1,30 @@ + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + 3.0.0-build-20181114.5 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-alpha1-10742 + 3.0.0-preview-181113-11 + 3.0.0-preview-181113-11 + 3.0.0-preview-181113-11 + 3.0.0-preview-181113-11 + 3.0.0-preview-181113-11 + 3.0.0-preview1-26907-05 + 3.0.0-alpha1-10742 + 2.0.3 + 11.0.2 + 4.10.0-preview1-26907-04 + + + + diff --git a/build/repo.props b/build/repo.props new file mode 100644 index 00000000..4402da1d --- /dev/null +++ b/build/repo.props @@ -0,0 +1,13 @@ + + + + + + Internal.AspNetCore.Universe.Lineup + https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json + + + + + + diff --git a/build/sources.props b/build/sources.props new file mode 100644 index 00000000..9215df97 --- /dev/null +++ b/build/sources.props @@ -0,0 +1,17 @@ + + + + + $(DotNetRestoreSources) + + $(RestoreSources); + https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; + https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; + https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; + + + $(RestoreSources); + https://api.nuget.org/v3/index.json; + + + diff --git a/global.json b/global.json deleted file mode 100644 index 983ba040..00000000 --- a/global.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "projects": ["src"] -} diff --git a/korebuild-lock.txt b/korebuild-lock.txt new file mode 100644 index 00000000..73613543 --- /dev/null +++ b/korebuild-lock.txt @@ -0,0 +1,2 @@ +version:3.0.0-build-20181114.5 +commithash:880e9a204d4ee4a18dfd83c9fb05a192a28bca60 diff --git a/korebuild.json b/korebuild.json new file mode 100644 index 00000000..f098e7f9 --- /dev/null +++ b/korebuild.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/master/tools/korebuild.schema.json", + "channel": "master", + "toolsets": { + "nodejs": { + "required": true, + "minVersion": "6.9" + } + } +} diff --git a/makefile.shade b/makefile.shade deleted file mode 100755 index 562494d1..00000000 --- a/makefile.shade +++ /dev/null @@ -1,7 +0,0 @@ - -var VERSION='0.1' -var FULL_VERSION='0.1' -var AUTHORS='Microsoft Open Technologies, Inc.' - -use-standard-lifecycle -k-standard-goals diff --git a/pack-local.sh b/pack-local.sh deleted file mode 100755 index f807152a..00000000 --- a/pack-local.sh +++ /dev/null @@ -1,22 +0,0 @@ -versionSuffix=$1 -dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -projects=( - ./src/Microsoft.AspNetCore.NodeServices - ./src/Microsoft.AspNetCore.SpaServices - ./src/Microsoft.AspNetCore.AngularServices - ./src/Microsoft.AspNetCore.ReactServices -) - -if [ -z "$versionSuffix" ]; then - echo "Usage: pack-local.sh " - echo "Example: pack-local.sh beta-000001" - exit 1 -fi - -pushd $dir > /dev/null - -for proj in "${projects[@]}"; do - dotnet pack $proj --version-suffix $versionSuffix -o ./artifacts/ -done - -popd > /dev/null diff --git a/run.cmd b/run.cmd new file mode 100644 index 00000000..d52d5c7e --- /dev/null +++ b/run.cmd @@ -0,0 +1,2 @@ +@ECHO OFF +PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' %*; exit $LASTEXITCODE" diff --git a/run.ps1 b/run.ps1 new file mode 100644 index 00000000..34604c71 --- /dev/null +++ b/run.ps1 @@ -0,0 +1,209 @@ +#!/usr/bin/env powershell +#requires -version 4 + +<# +.SYNOPSIS +Executes KoreBuild commands. + +.DESCRIPTION +Downloads korebuild if required. Then executes the KoreBuild command. To see available commands, execute with `-Command help`. + +.PARAMETER Command +The KoreBuild command to run. + +.PARAMETER Path +The folder to build. Defaults to the folder containing this script. + +.PARAMETER Channel +The channel of KoreBuild to download. Overrides the value from the config file. + +.PARAMETER DotNetHome +The directory where .NET Core tools will be stored. + +.PARAMETER ToolsSource +The base url where build tools can be downloaded. Overrides the value from the config file. + +.PARAMETER Update +Updates KoreBuild to the latest version even if a lock file is present. + +.PARAMETER Reinstall +Re-installs KoreBuild + +.PARAMETER ConfigFile +The path to the configuration file that stores values. Defaults to korebuild.json. + +.PARAMETER ToolsSourceSuffix +The Suffix to append to the end of the ToolsSource. Useful for query strings in blob stores. + +.PARAMETER CI +Sets up CI specific settings and variables. + +.PARAMETER Arguments +Arguments to be passed to the command + +.NOTES +This function will create a file $PSScriptRoot/korebuild-lock.txt. This lock file can be committed to source, but does not have to be. +When the lockfile is not present, KoreBuild will create one using latest available version from $Channel. + +The $ConfigFile is expected to be an JSON file. It is optional, and the configuration values in it are optional as well. Any options set +in the file are overridden by command line parameters. + +.EXAMPLE +Example config file: +```json +{ + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/master/tools/korebuild.schema.json", + "channel": "master", + "toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools" +} +``` +#> +[CmdletBinding(PositionalBinding = $false)] +param( + [Parameter(Mandatory = $true, Position = 0)] + [string]$Command, + [string]$Path = $PSScriptRoot, + [Alias('c')] + [string]$Channel, + [Alias('d')] + [string]$DotNetHome, + [Alias('s')] + [string]$ToolsSource, + [Alias('u')] + [switch]$Update, + [switch]$Reinstall, + [string]$ToolsSourceSuffix, + [string]$ConfigFile = $null, + [switch]$CI, + [Parameter(ValueFromRemainingArguments = $true)] + [string[]]$Arguments +) + +Set-StrictMode -Version 2 +$ErrorActionPreference = 'Stop' + +# +# Functions +# + +function Get-KoreBuild { + + $lockFile = Join-Path $Path 'korebuild-lock.txt' + + if (!(Test-Path $lockFile) -or $Update) { + Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile $ToolsSourceSuffix + } + + $version = Get-Content $lockFile | Where-Object { $_ -like 'version:*' } | Select-Object -first 1 + if (!$version) { + Write-Error "Failed to parse version from $lockFile. Expected a line that begins with 'version:'" + } + $version = $version.TrimStart('version:').Trim() + $korebuildPath = Join-Paths $DotNetHome ('buildtools', 'korebuild', $version) + + if ($Reinstall -and (Test-Path $korebuildPath)) { + Remove-Item -Force -Recurse $korebuildPath + } + + if (!(Test-Path $korebuildPath)) { + Write-Host -ForegroundColor Magenta "Downloading KoreBuild $version" + New-Item -ItemType Directory -Path $korebuildPath | Out-Null + $remotePath = "$ToolsSource/korebuild/artifacts/$version/korebuild.$version.zip" + + try { + $tmpfile = Join-Path ([IO.Path]::GetTempPath()) "KoreBuild-$([guid]::NewGuid()).zip" + Get-RemoteFile $remotePath $tmpfile $ToolsSourceSuffix + if (Get-Command -Name 'Microsoft.PowerShell.Archive\Expand-Archive' -ErrorAction Ignore) { + # Use built-in commands where possible as they are cross-plat compatible + Microsoft.PowerShell.Archive\Expand-Archive -Path $tmpfile -DestinationPath $korebuildPath + } + else { + # Fallback to old approach for old installations of PowerShell + Add-Type -AssemblyName System.IO.Compression.FileSystem + [System.IO.Compression.ZipFile]::ExtractToDirectory($tmpfile, $korebuildPath) + } + } + catch { + Remove-Item -Recurse -Force $korebuildPath -ErrorAction Ignore + throw + } + finally { + Remove-Item $tmpfile -ErrorAction Ignore + } + } + + return $korebuildPath +} + +function Join-Paths([string]$path, [string[]]$childPaths) { + $childPaths | ForEach-Object { $path = Join-Path $path $_ } + return $path +} + +function Get-RemoteFile([string]$RemotePath, [string]$LocalPath, [string]$RemoteSuffix) { + if ($RemotePath -notlike 'http*') { + Copy-Item $RemotePath $LocalPath + return + } + + $retries = 10 + while ($retries -gt 0) { + $retries -= 1 + try { + Invoke-WebRequest -UseBasicParsing -Uri $($RemotePath + $RemoteSuffix) -OutFile $LocalPath + return + } + catch { + Write-Verbose "Request failed. $retries retries remaining" + } + } + + Write-Error "Download failed: '$RemotePath'." +} + +# +# Main +# + +# Load configuration or set defaults + +$Path = Resolve-Path $Path +if (!$ConfigFile) { $ConfigFile = Join-Path $Path 'korebuild.json' } + +if (Test-Path $ConfigFile) { + try { + $config = Get-Content -Raw -Encoding UTF8 -Path $ConfigFile | ConvertFrom-Json + if ($config) { + if (!($Channel) -and (Get-Member -Name 'channel' -InputObject $config)) { [string] $Channel = $config.channel } + if (!($ToolsSource) -and (Get-Member -Name 'toolsSource' -InputObject $config)) { [string] $ToolsSource = $config.toolsSource} + } + } + catch { + Write-Host -ForegroundColor Red $Error[0] + Write-Error "$ConfigFile contains invalid JSON." + exit 1 + } +} + +if (!$DotNetHome) { + $DotNetHome = if ($env:DOTNET_HOME) { $env:DOTNET_HOME } ` + elseif ($env:USERPROFILE) { Join-Path $env:USERPROFILE '.dotnet'} ` + elseif ($env:HOME) {Join-Path $env:HOME '.dotnet'}` + else { Join-Path $PSScriptRoot '.dotnet'} +} + +if (!$Channel) { $Channel = 'master' } +if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' } + +# Execute + +$korebuildPath = Get-KoreBuild +Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1') + +try { + Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile -CI:$CI + Invoke-KoreBuildCommand $Command @Arguments +} +finally { + Remove-Module 'KoreBuild' -ErrorAction Ignore +} diff --git a/run.sh b/run.sh new file mode 100755 index 00000000..4c1fed56 --- /dev/null +++ b/run.sh @@ -0,0 +1,256 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# +# variables +# + +RESET="\033[0m" +RED="\033[0;31m" +YELLOW="\033[0;33m" +MAGENTA="\033[0;95m" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +[ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet" +verbose=false +update=false +reinstall=false +repo_path="$DIR" +channel='' +tools_source='' +tools_source_suffix='' +ci=false + +# +# Functions +# +__usage() { + echo "Usage: $(basename "${BASH_SOURCE[0]}") command [options] [[--] ...]" + echo "" + echo "Arguments:" + echo " command The command to be run." + echo " ... Arguments passed to the command. Variable number of arguments allowed." + echo "" + echo "Options:" + echo " --verbose Show verbose output." + echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." + echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json." + echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." + echo " --path The directory to build. Defaults to the directory containing the script." + echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file." + echo " --tools-source-suffix|-ToolsSourceSuffix The suffix to append to tools-source. Useful for query strings." + echo " -u|--update Update to the latest KoreBuild even if the lock file is present." + echo " --reinstall Reinstall KoreBuild." + echo " --ci Apply CI specific settings and environment variables." + echo "" + echo "Description:" + echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be." + echo " When the lockfile is not present, KoreBuild will create one using latest available version from \$channel." + + if [[ "${1:-}" != '--no-exit' ]]; then + exit 2 + fi +} + +get_korebuild() { + local version + local lock_file="$repo_path/korebuild-lock.txt" + if [ ! -f "$lock_file" ] || [ "$update" = true ]; then + __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" "$tools_source_suffix" + fi + version="$(grep 'version:*' -m 1 "$lock_file")" + if [[ "$version" == '' ]]; then + __error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'" + return 1 + fi + version="$(echo "${version#version:}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" + local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version" + + if [ "$reinstall" = true ] && [ -d "$korebuild_path" ]; then + rm -rf "$korebuild_path" + fi + + { + if [ ! -d "$korebuild_path" ]; then + mkdir -p "$korebuild_path" + local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" + tmpfile="$(mktemp)" + echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" + if __get_remote_file "$remote_path" "$tmpfile" "$tools_source_suffix"; then + unzip -q -d "$korebuild_path" "$tmpfile" + fi + rm "$tmpfile" || true + fi + + source "$korebuild_path/KoreBuild.sh" + } || { + if [ -d "$korebuild_path" ]; then + echo "Cleaning up after failed installation" + rm -rf "$korebuild_path" || true + fi + return 1 + } +} + +__error() { + echo -e "${RED}error: $*${RESET}" 1>&2 +} + +__warn() { + echo -e "${YELLOW}warning: $*${RESET}" +} + +__machine_has() { + hash "$1" > /dev/null 2>&1 + return $? +} + +__get_remote_file() { + local remote_path=$1 + local local_path=$2 + local remote_path_suffix=$3 + + if [[ "$remote_path" != 'http'* ]]; then + cp "$remote_path" "$local_path" + return 0 + fi + + local failed=false + if __machine_has wget; then + wget --tries 10 --quiet -O "$local_path" "${remote_path}${remote_path_suffix}" || failed=true + else + failed=true + fi + + if [ "$failed" = true ] && __machine_has curl; then + failed=false + curl --retry 10 -sSL -f --create-dirs -o "$local_path" "${remote_path}${remote_path_suffix}" || failed=true + fi + + if [ "$failed" = true ]; then + __error "Download failed: $remote_path" 1>&2 + return 1 + fi +} + +# +# main +# + +command="${1:-}" +shift + +while [[ $# -gt 0 ]]; do + case $1 in + -\?|-h|--help) + __usage --no-exit + exit 0 + ;; + -c|--channel|-Channel) + shift + channel="${1:-}" + [ -z "$channel" ] && __usage + ;; + --config-file|-ConfigFile) + shift + config_file="${1:-}" + [ -z "$config_file" ] && __usage + if [ ! -f "$config_file" ]; then + __error "Invalid value for --config-file. $config_file does not exist." + exit 1 + fi + ;; + -d|--dotnet-home|-DotNetHome) + shift + DOTNET_HOME="${1:-}" + [ -z "$DOTNET_HOME" ] && __usage + ;; + --path|-Path) + shift + repo_path="${1:-}" + [ -z "$repo_path" ] && __usage + ;; + -s|--tools-source|-ToolsSource) + shift + tools_source="${1:-}" + [ -z "$tools_source" ] && __usage + ;; + --tools-source-suffix|-ToolsSourceSuffix) + shift + tools_source_suffix="${1:-}" + [ -z "$tools_source_suffix" ] && __usage + ;; + -u|--update|-Update) + update=true + ;; + --reinstall|-[Rr]einstall) + reinstall=true + ;; + --ci|-[Cc][Ii]) + ci=true + ;; + --verbose|-Verbose) + verbose=true + ;; + --) + shift + break + ;; + *) + break + ;; + esac + shift +done + +if ! __machine_has unzip; then + __error 'Missing required command: unzip' + exit 1 +fi + +if ! __machine_has curl && ! __machine_has wget; then + __error 'Missing required command. Either wget or curl is required.' + exit 1 +fi + +[ -z "${config_file:-}" ] && config_file="$repo_path/korebuild.json" +if [ -f "$config_file" ]; then + if __machine_has jq ; then + if jq '.' "$config_file" >/dev/null ; then + config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")" + config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")" + else + __error "$config_file contains invalid JSON." + exit 1 + fi + elif __machine_has python ; then + if python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then + config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")" + config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" + else + __error "$config_file contains invalid JSON." + exit 1 + fi + elif __machine_has python3 ; then + if python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then + config_channel="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")" + config_tools_source="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" + else + __error "$config_file contains invalid JSON." + exit 1 + fi + else + __error 'Missing required command: jq or python. Could not parse the JSON file.' + exit 1 + fi + + [ ! -z "${config_channel:-}" ] && channel="$config_channel" + [ ! -z "${config_tools_source:-}" ] && tools_source="$config_tools_source" +fi + +[ -z "$channel" ] && channel='master' +[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' + +get_korebuild +set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file" "$ci" +invoke_korebuild_command "$command" "$@" diff --git a/samples/angular/MusicStore/.gitignore b/samples/angular/MusicStore/.gitignore deleted file mode 100644 index 762a3e6c..00000000 --- a/samples/angular/MusicStore/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -/node_modules/ -/wwwroot/lib/ -/wwwroot/ng-app/**/*.js -/project.lock.json -/music-db.sqlite -/Properties/launchSettings.json - -# Obviously you don't really want your DB to go in wwwroot, but due to https://github.com/aspnet/Microsoft.Data.Sqlite/issues/188 -# it currently does when run from IIS Express. Will resolve this once RC2 is out, which is supposed to eliminate the inconsistency. -/wwwroot/music-db.sqlite diff --git a/samples/angular/MusicStore/Apis/AlbumsApiController.cs b/samples/angular/MusicStore/Apis/AlbumsApiController.cs deleted file mode 100644 index 3b98a1eb..00000000 --- a/samples/angular/MusicStore/Apis/AlbumsApiController.cs +++ /dev/null @@ -1,216 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using AutoMapper; -using MusicStore.Models; -using MusicStore.Infrastructure; - -namespace MusicStore.Apis -{ - [Route("api/albums")] - public class AlbumsApiController : Controller - { - private readonly MusicStoreContext _storeContext; - - public AlbumsApiController(MusicStoreContext storeContext) - { - _storeContext = storeContext; - } - - [HttpGet] - [NoCache] - public async Task Paged(int page = 1, int pageSize = 50, string sortBy = null) - { - await _storeContext.Genres.LoadAsync(); - await _storeContext.Artists.LoadAsync(); - - var albums = await _storeContext.Albums - .Include(a => a.Genre) - .Include(a => a.Artist) - .ToPagedListAsync(page, pageSize, sortBy, - a => a.Title, // sortExpression - SortDirection.Ascending, // defaultSortDirection - a => Mapper.Map(a, new AlbumResultDto())); // selector - - return Json(albums); - } - - [HttpGet("all")] - [NoCache] - public async Task All() - { - var albums = await _storeContext.Albums - .Include(a => a.Genre) - .Include(a => a.Artist) - .OrderBy(a => a.Title) - .ToListAsync(); - - return Json(albums.Select(a => Mapper.Map(a, new AlbumResultDto()))); - } - - [HttpGet("mostPopular")] - [NoCache] - public async Task MostPopular(int count = 6) - { - count = count > 0 && count < 20 ? count : 6; - var albums = await _storeContext.Albums - .OrderByDescending(a => a.OrderDetails.Count()) - .Take(count) - .ToListAsync(); - - // TODO: Move the .Select() to end of albums query when EF supports it - return Json(albums.Select(a => Mapper.Map(a, new AlbumResultDto()))); - } - - [HttpGet("{albumId:int}")] - [NoCache] - public async Task Details(int albumId) - { - await _storeContext.Genres.LoadAsync(); - await _storeContext.Artists.LoadAsync(); - - var album = await _storeContext.Albums - .Include(a => a.Artist) - .Include(a => a.Genre) - .Where(a => a.AlbumId == albumId) - .SingleOrDefaultAsync(); - - var albumResult = Mapper.Map(album, new AlbumResultDto()); - - // TODO: Add null checking and return 404 in that case - - return Json(albumResult); - } - - [HttpPost] - [Authorize("app-ManageStore")] - public async Task CreateAlbum([FromBody]AlbumChangeDto album) - { - if (!ModelState.IsValid) - { - // Return the model errors - return BadRequest(ModelState); - } - - // Save the changes to the DB - var dbAlbum = new Album(); - _storeContext.Albums.Add(Mapper.Map(album, dbAlbum)); - await _storeContext.SaveChangesAsync(); - - // TODO: Handle missing record, key violations, concurrency issues, etc. - - return new ObjectResult(new { - Data = dbAlbum.AlbumId, - Message = "Album created successfully." - }); - } - - [HttpPut("{albumId:int}/update")] - public async Task UpdateAlbum(int albumId, [FromBody] AlbumChangeDto album) - { - if (!ModelState.IsValid) - { - // Return the model errors - return BadRequest(ModelState); - } - - var dbAlbum = await _storeContext.Albums.SingleOrDefaultAsync(a => a.AlbumId == albumId); - - if (dbAlbum == null) - { - return new ObjectResult(new { - Message = string.Format("The album with ID {0} was not found.", albumId) - }) { StatusCode = 404 }; - } - - // Save the changes to the DB - Mapper.Map(album, dbAlbum); - await _storeContext.SaveChangesAsync(); - - // TODO: Handle missing record, key violations, concurrency issues, etc. - - return new ObjectResult (new { - Message = "Album updated successfully." - }); - } - - [HttpDelete("{albumId:int}")] - [Authorize("app-ManageStore")] - public async Task DeleteAlbum(int albumId) - { - var album = await _storeContext.Albums.SingleOrDefaultAsync(a => a.AlbumId == albumId); - - if (album != null) - { - _storeContext.Albums.Remove(album); - - // Save the changes to the DB - await _storeContext.SaveChangesAsync(); - - // TODO: Handle missing record, key violations, concurrency issues, etc. - } - - return new ObjectResult (new { - Message = "Album deleted successfully." - }); - } - } - - [ModelMetadataType(typeof(Album))] - public class AlbumChangeDto : IValidatableObject - { - public int GenreId { get; set; } - - public int ArtistId { get; set; } - - public string Title { get; set; } - - public decimal Price { get; set; } - - public string AlbumArtUrl { get; set; } - - public IEnumerable Validate(ValidationContext validationContext) - { - // An example of object-level (i.e., multi-property) validation - if (this.GenreId == 13 /* Indie */) { - switch (SentimentAnalysis.GetSentiment(Title)) { - case SentimentAnalysis.SentimentResult.Positive: - yield return new ValidationResult("Sounds too positive. Indie music requires more ambiguity."); - break; - case SentimentAnalysis.SentimentResult.Negative: - yield return new ValidationResult("Sounds too negative. Indie music requires more ambiguity."); - break; - } - } - } - } - - public class AlbumResultDto : AlbumChangeDto - { - public AlbumResultDto() - { - Artist = new ArtistResultDto(); - Genre = new GenreResultDto(); - } - - public int AlbumId { get; set; } - - public ArtistResultDto Artist { get; private set; } - - public GenreResultDto Genre { get; private set; } - } - - public class ArtistResultDto - { - public string Name { get; set; } - } - - public class GenreResultDto - { - public string Name { get; set; } - } -} diff --git a/samples/angular/MusicStore/Apis/ArtistsApiController.cs b/samples/angular/MusicStore/Apis/ArtistsApiController.cs deleted file mode 100644 index f3568aeb..00000000 --- a/samples/angular/MusicStore/Apis/ArtistsApiController.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using MusicStore.Models; - -namespace MusicStore.Apis -{ - [Route("api/artists")] - public class ArtistsApiController : Controller - { - private readonly MusicStoreContext _storeContext; - - public ArtistsApiController(MusicStoreContext storeContext) - { - _storeContext = storeContext; - } - - [HttpGet("lookup")] - public async Task Lookup() - { - var artists = await _storeContext.Artists - .OrderBy(a => a.Name) - .ToListAsync(); - - return Json(artists); - } - } -} diff --git a/samples/angular/MusicStore/Apis/GenresApiController.cs b/samples/angular/MusicStore/Apis/GenresApiController.cs deleted file mode 100644 index 338ca2fc..00000000 --- a/samples/angular/MusicStore/Apis/GenresApiController.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using MusicStore.Models; -using MusicStore.Infrastructure; - -namespace MusicStore.Apis -{ - [Route("api/genres")] - public class GenresApiController : Controller - { - private readonly MusicStoreContext _storeContext; - - public GenresApiController(MusicStoreContext storeContext) - { - _storeContext = storeContext; - } - - [HttpGet] - public async Task GenreList() - { - var genres = await _storeContext.Genres - //.Include(g => g.Albums) - .OrderBy(g => g.Name) - .ToListAsync(); - - return Json(genres); - } - - [HttpGet("genre-lookup")] - public async Task Lookup() - { - var genres = await _storeContext.Genres - .Select(g => new { g.GenreId, g.Name }) - .ToListAsync(); - - return Json(genres); - } - - [HttpGet("menu")] - public async Task GenreMenuList(int count = 9) - { - count = count > 0 && count < 20 ? count : 9; - - var genres = await _storeContext.Genres - .OrderByDescending(g => - g.Albums.Sum(a => - a.OrderDetails.Sum(od => od.Quantity))) - .Take(count) - .ToListAsync(); - - return Json(genres); - } - - [HttpGet("{genreId:int}/albums")] - [NoCache] - public async Task GenreAlbums(int genreId) - { - var albums = await _storeContext.Albums - .Where(a => a.GenreId == genreId) - //.Include(a => a.Genre) - //.Include(a => a.Artist) - //.OrderBy(a => a.Genre.Name) - .ToListAsync(); - - return Json(albums); - } - } -} diff --git a/samples/angular/MusicStore/Apis/Models/AccountViewModels.cs b/samples/angular/MusicStore/Apis/Models/AccountViewModels.cs deleted file mode 100644 index 831978a5..00000000 --- a/samples/angular/MusicStore/Apis/Models/AccountViewModels.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace MusicStore.Models -{ - public class ExternalLoginConfirmationViewModel - { - [Required] - [Display(Name = "User name")] - public string UserName { get; set; } - } - - public class ManageUserViewModel - { - [Required] - [DataType(DataType.Password)] - [Display(Name = "Current password")] - public string OldPassword { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "New password")] - public string NewPassword { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm new password")] - [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } - - public class LoginViewModel - { - [Required] - [Display(Name = "User name")] - public string UserName { get; set; } - - [Required] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [Display(Name = "Remember me?")] - public bool RememberMe { get; set; } - } - - public class RegisterViewModel - { - [Required] - [Display(Name = "User name")] - public string UserName { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm password")] - [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } -} diff --git a/samples/angular/MusicStore/Apis/Models/Album.cs b/samples/angular/MusicStore/Apis/Models/Album.cs deleted file mode 100644 index b4495f34..00000000 --- a/samples/angular/MusicStore/Apis/Models/Album.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; - -namespace MusicStore.Models -{ - public class Album - { - public Album() - { - // TODO: Temporary hack to populate the orderdetails until EF does this automatically. - OrderDetails = new List(); - } - - [ScaffoldColumn(false)] - public int AlbumId { get; set; } - - public int GenreId { get; set; } - - public int ArtistId { get; set; } - - [Required] - [StringLength(160, MinimumLength = 2)] - public string Title { get; set; } - - [Required] - [RangeAttribute(typeof(decimal), "0.01", "100")] // Long-form constructor to work around https://github.com/dotnet/coreclr/issues/2172 - [DataType(DataType.Currency)] - public decimal Price { get; set; } - - [Display(Name = "Album Art URL")] - [StringLength(1024)] - public string AlbumArtUrl { get; set; } - - public virtual Genre Genre { get; set; } - - public virtual Artist Artist { get; set; } - - public virtual ICollection OrderDetails { get; set; } - } -} diff --git a/samples/angular/MusicStore/Apis/Models/Artist.cs b/samples/angular/MusicStore/Apis/Models/Artist.cs deleted file mode 100644 index b364a898..00000000 --- a/samples/angular/MusicStore/Apis/Models/Artist.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace MusicStore.Models -{ - public class Artist - { - public int ArtistId { get; set; } - - [Required] - public string Name { get; set; } - } -} diff --git a/samples/angular/MusicStore/Apis/Models/CartItem.cs b/samples/angular/MusicStore/Apis/Models/CartItem.cs deleted file mode 100644 index 7209462d..00000000 --- a/samples/angular/MusicStore/Apis/Models/CartItem.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; - -namespace MusicStore.Models -{ - public class CartItem - { - [Key] - public int CartItemId { get; set; } - - [Required] - public string CartId { get; set; } - public int AlbumId { get; set; } - public int Count { get; set; } - - [DataType(DataType.DateTime)] - public DateTime DateCreated { get; set; } - - public virtual Album Album { get; set; } - } -} diff --git a/samples/angular/MusicStore/Apis/Models/Genre.cs b/samples/angular/MusicStore/Apis/Models/Genre.cs deleted file mode 100644 index eed5616c..00000000 --- a/samples/angular/MusicStore/Apis/Models/Genre.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Newtonsoft.Json; - -namespace MusicStore.Models -{ - public class Genre - { - public Genre() - { - Albums = new List(); - } - - public int GenreId { get; set; } - - [Required] - public string Name { get; set; } - - public string Description { get; set; } - - [JsonIgnore] - public virtual ICollection Albums { get; set; } - } -} diff --git a/samples/angular/MusicStore/Apis/Models/MusicStoreContext.cs b/samples/angular/MusicStore/Apis/Models/MusicStoreContext.cs deleted file mode 100644 index aee7aedd..00000000 --- a/samples/angular/MusicStore/Apis/Models/MusicStoreContext.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; - -namespace MusicStore.Models -{ - public class ApplicationUser : IdentityUser { } - - public class MusicStoreContext : IdentityDbContext - { - public MusicStoreContext(DbContextOptions options) : base(options) - { - } - - public DbSet Albums { get; set; } - public DbSet Artists { get; set; } - public DbSet Orders { get; set; } - public DbSet Genres { get; set; } - public DbSet CartItems { get; set; } - public DbSet OrderDetails { get; set; } - - protected override void OnModelCreating(ModelBuilder builder) - { - // Configure pluralization - builder.Entity().ToTable("Albums"); - builder.Entity().ToTable("Artists"); - builder.Entity().ToTable("Orders"); - builder.Entity().ToTable("Genres"); - builder.Entity().ToTable("CartItems"); - builder.Entity().ToTable("OrderDetails"); - - base.OnModelCreating(builder); - } - } -} diff --git a/samples/angular/MusicStore/Apis/Models/Order.cs b/samples/angular/MusicStore/Apis/Models/Order.cs deleted file mode 100644 index 110a77d8..00000000 --- a/samples/angular/MusicStore/Apis/Models/Order.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; - -namespace MusicStore.Models -{ - //[Bind(Include = "FirstName,LastName,Address,City,State,PostalCode,Country,Phone,Email")] - public class Order - { - public Order() - { - OrderDetails = new List(); - } - - [ScaffoldColumn(false)] - public int OrderId { get; set; } - - [ScaffoldColumn(false)] - public DateTime OrderDate { get; set; } - - [Required] - [ScaffoldColumn(false)] - public string Username { get; set; } - - [Required] - [Display(Name = "First Name")] - [StringLength(160)] - public string FirstName { get; set; } - - [Required] - [Display(Name = "Last Name")] - [StringLength(160)] - public string LastName { get; set; } - - [Required] - [StringLength(70, MinimumLength = 3)] - public string Address { get; set; } - - [Required] - [StringLength(40)] - public string City { get; set; } - - [Required] - [StringLength(40)] - public string State { get; set; } - - [Required] - [Display(Name = "Postal Code")] - [StringLength(10, MinimumLength = 5)] - public string PostalCode { get; set; } - - [Required] - [StringLength(40)] - public string Country { get; set; } - - [Required] - [StringLength(24)] - [DataType(DataType.PhoneNumber)] - public string Phone { get; set; } - - [Required] - [Display(Name = "Email Address")] - [RegularExpression(@"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}", - ErrorMessage = "Email is not valid.")] - [DataType(DataType.EmailAddress)] - public string Email { get; set; } - - [ScaffoldColumn(false)] - public decimal Total { get; set; } - - public ICollection OrderDetails { get; set; } - } -} diff --git a/samples/angular/MusicStore/Apis/Models/OrderDetail.cs b/samples/angular/MusicStore/Apis/Models/OrderDetail.cs deleted file mode 100644 index cb1e6930..00000000 --- a/samples/angular/MusicStore/Apis/Models/OrderDetail.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace MusicStore.Models -{ - public class OrderDetail - { - public int OrderDetailId { get; set; } - public int OrderId { get; set; } - public int AlbumId { get; set; } - public int Quantity { get; set; } - public decimal UnitPrice { get; set; } - - public virtual Album Album { get; set; } - public virtual Order Order { get; set; } - } -} diff --git a/samples/angular/MusicStore/Apis/Models/SampleData.cs b/samples/angular/MusicStore/Apis/Models/SampleData.cs deleted file mode 100644 index b1d98a7c..00000000 --- a/samples/angular/MusicStore/Apis/Models/SampleData.cs +++ /dev/null @@ -1,915 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; - -namespace MusicStore.Models -{ - public static class SampleData - { - const string imgUrl = "/images/placeholder.png"; - - public static async Task InitializeMusicStoreDatabaseAsync(IServiceProvider serviceProvider) - { - using (var db = serviceProvider.GetService()) - { - if (await db.Database.EnsureCreatedAsync()) - { - await InsertTestData(serviceProvider); - } - } - } - - private static async Task InsertTestData(IServiceProvider serviceProvider) - { - var albums = GetAlbums(imgUrl, Genres, Artists); - await AddOrUpdateAsync(serviceProvider, g => g.GenreId, Genres.Select(genre => genre.Value)); - await AddOrUpdateAsync(serviceProvider, a => a.ArtistId, Artists.Select(artist => artist.Value)); - await AddOrUpdateAsync(serviceProvider, a => a.AlbumId, albums); - } - - // TODO [EF] This may be replaced by a first class mechanism in EF - private static async Task AddOrUpdateAsync( - IServiceProvider serviceProvider, - Func propertyToMatch, IEnumerable entities) - where TEntity : class - { - // Query in a separate context so that we can attach existing entities as modified - List existingData; - - using (var scope = serviceProvider.GetRequiredService().CreateScope()) - using (var db = scope.ServiceProvider.GetService()) - { - existingData = db.Set().ToList(); - } - - using (var scope = serviceProvider.GetRequiredService().CreateScope()) - using (var db = scope.ServiceProvider.GetService()) - { - foreach (var item in entities) - { - db.Entry(item).State = existingData.Any(g => propertyToMatch(g).Equals(propertyToMatch(item))) - ? EntityState.Modified - : EntityState.Added; - } - - await db.SaveChangesAsync(); - } - } - - private static Album[] GetAlbums(string imgUrl, Dictionary genres, Dictionary artists) - { - var albums = new Album[] - { - new Album { Title = "The Best Of The Men At Work", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Men At Work"], AlbumArtUrl = imgUrl }, - new Album { Title = "...And Justice For All", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "עד גבול האור", Genre = genres["World"], Price = 8.99M, Artist = artists["אריק אינשטיין"], AlbumArtUrl = imgUrl }, - new Album { Title = "Black Light Syndrome", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Terry Bozzio, Tony Levin & Steve Stevens"], AlbumArtUrl = imgUrl }, - new Album { Title = "10,000 Days", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Tool"], AlbumArtUrl = imgUrl }, - new Album { Title = "11i", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Supreme Beings of Leisure"], AlbumArtUrl = imgUrl }, - new Album { Title = "1960", Genre = genres["Indie"], Price = 8.99M, Artist = artists["Soul-Junk"], AlbumArtUrl = imgUrl }, - new Album { Title = "4x4=12 ", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["deadmau5"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Copland Celebration, Vol. I", Genre = genres["Classical"], Price = 8.99M, Artist = artists["London Symphony Orchestra"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Lively Mind", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Paul Oakenfold"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Matter of Life and Death", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Real Dead One", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Real Live One", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Rush of Blood to the Head", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Coldplay"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Soprano Inspired", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Britten Sinfonia, Ivor Bolton & Lesley Garrett"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Winter Symphony", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "Abbey Road", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Beatles"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ace Of Spades", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Motörhead"], AlbumArtUrl = imgUrl }, - new Album { Title = "Achtung Baby", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "Acústico MTV", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Os Paralamas Do Sucesso"], AlbumArtUrl = imgUrl }, - new Album { Title = "Adams, John: The Chairman Dances", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Edo de Waart & San Francisco Symphony"], AlbumArtUrl = imgUrl }, - new Album { Title = "Adrenaline", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deftones"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ænima", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Tool"], AlbumArtUrl = imgUrl }, - new Album { Title = "Afrociberdelia", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Chico Science & Nação Zumbi"], AlbumArtUrl = imgUrl }, - new Album { Title = "After the Goldrush", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Neil Young"], AlbumArtUrl = imgUrl }, - new Album { Title = "Airdrawn Dagger", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Sasha"], AlbumArtUrl = imgUrl }, - new Album { Title = "Album Title Goes Here", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["deadmau5"], AlbumArtUrl = imgUrl }, - new Album { Title = "Alcohol Fueled Brewtality Live! [Disc 1]", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Black Label Society"], AlbumArtUrl = imgUrl }, - new Album { Title = "Alcohol Fueled Brewtality Live! [Disc 2]", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Black Label Society"], AlbumArtUrl = imgUrl }, - new Album { Title = "Alive 2007", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Daft Punk"], AlbumArtUrl = imgUrl }, - new Album { Title = "All I Ask of You", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "Amen (So Be It)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Paddy Casey"], AlbumArtUrl = imgUrl }, - new Album { Title = "Animal Vehicle", Genre = genres["Pop"], Price = 8.99M, Artist = artists["The Axis of Awesome"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ao Vivo [IMPORT]", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Zeca Pagodinho"], AlbumArtUrl = imgUrl }, - new Album { Title = "Apocalyptic Love", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Slash"], AlbumArtUrl = imgUrl }, - new Album { Title = "Appetite for Destruction", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Guns N' Roses"], AlbumArtUrl = imgUrl }, - new Album { Title = "Are You Experienced?", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Jimi Hendrix"], AlbumArtUrl = imgUrl }, - new Album { Title = "Arquivo II", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Os Paralamas Do Sucesso"], AlbumArtUrl = imgUrl }, - new Album { Title = "Arquivo Os Paralamas Do Sucesso", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Os Paralamas Do Sucesso"], AlbumArtUrl = imgUrl }, - new Album { Title = "A-Sides", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Soundgarden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Audioslave", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Audioslave"], AlbumArtUrl = imgUrl }, - new Album { Title = "Automatic for the People", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["R.E.M."], AlbumArtUrl = imgUrl }, - new Album { Title = "Axé Bahia 2001", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Various Artists"], AlbumArtUrl = imgUrl }, - new Album { Title = "Babel", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Mumford & Sons"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bach: Goldberg Variations", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Wilhelm Kempff"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bach: The Brandenburg Concertos", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Orchestra of The Age of Enlightenment"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bach: The Cello Suites", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Yo-Yo Ma"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bach: Toccata & Fugue in D Minor", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Ton Koopman"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bad Motorfinger", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Soundgarden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Balls to the Wall", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Accept"], AlbumArtUrl = imgUrl }, - new Album { Title = "Banadeek Ta'ala", Genre = genres["World"], Price = 8.99M, Artist = artists["Amr Diab"], AlbumArtUrl = imgUrl }, - new Album { Title = "Barbie Girl", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Aqua"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bark at the Moon (Remastered)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Ozzy Osbourne"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bartok: Violin & Viola Concertos", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Yehudi Menuhin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Barulhinho Bom", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Marisa Monte"], AlbumArtUrl = imgUrl }, - new Album { Title = "BBC Sessions [Disc 1] [Live]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "BBC Sessions [Disc 2] [Live]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Be Here Now", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Oasis"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bedrock 11 Compiled & Mixed", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["John Digweed"], AlbumArtUrl = imgUrl }, - new Album { Title = "Berlioz: Symphonie Fantastique", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Michael Tilson Thomas"], AlbumArtUrl = imgUrl }, - new Album { Title = "Beyond Good And Evil", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Cult"], AlbumArtUrl = imgUrl }, - new Album { Title = "Big Bad Wolf ", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Armand Van Helden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Big Ones", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Aerosmith"], AlbumArtUrl = imgUrl }, - new Album { Title = "Black Album", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Black Sabbath Vol. 4 (Remaster)", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Black Sabbath"], AlbumArtUrl = imgUrl }, - new Album { Title = "Black Sabbath", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Black Sabbath"], AlbumArtUrl = imgUrl }, - new Album { Title = "Black", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Blackwater Park", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Opeth"], AlbumArtUrl = imgUrl }, - new Album { Title = "Blizzard of Ozz", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Ozzy Osbourne"], AlbumArtUrl = imgUrl }, - new Album { Title = "Blood", Genre = genres["Rock"], Price = 8.99M, Artist = artists["In This Moment"], AlbumArtUrl = imgUrl }, - new Album { Title = "Blue Moods", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Incognito"], AlbumArtUrl = imgUrl }, - new Album { Title = "Blue", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Weezer"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bongo Fury", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Frank Zappa & Captain Beefheart"], AlbumArtUrl = imgUrl }, - new Album { Title = "Boys & Girls", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Alabama Shakes"], AlbumArtUrl = imgUrl }, - new Album { Title = "Brave New World", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "B-Sides 1980-1990", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bunkka", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Paul Oakenfold"], AlbumArtUrl = imgUrl }, - new Album { Title = "By The Way", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Red Hot Chili Peppers"], AlbumArtUrl = imgUrl }, - new Album { Title = "Cake: B-Sides and Rarities", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Cake"], AlbumArtUrl = imgUrl }, - new Album { Title = "Californication", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Red Hot Chili Peppers"], AlbumArtUrl = imgUrl }, - new Album { Title = "Carmina Burana", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Boston Symphony Orchestra & Seiji Ozawa"], AlbumArtUrl = imgUrl }, - new Album { Title = "Carried to Dust (Bonus Track Version)", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Calexico"], AlbumArtUrl = imgUrl }, - new Album { Title = "Carry On", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Chris Cornell"], AlbumArtUrl = imgUrl }, - new Album { Title = "Cássia Eller - Sem Limite [Disc 1]", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Cássia Eller"], AlbumArtUrl = imgUrl }, - new Album { Title = "Chemical Wedding", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Bruce Dickinson"], AlbumArtUrl = imgUrl }, - new Album { Title = "Chill: Brazil (Disc 1)", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Marcos Valle"], AlbumArtUrl = imgUrl }, - new Album { Title = "Chill: Brazil (Disc 2)", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Antônio Carlos Jobim"], AlbumArtUrl = imgUrl }, - new Album { Title = "Chocolate Starfish And The Hot Dog Flavored Water", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Limp Bizkit"], AlbumArtUrl = imgUrl }, - new Album { Title = "Chronicle, Vol. 1", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Creedence Clearwater Revival"], AlbumArtUrl = imgUrl }, - new Album { Title = "Chronicle, Vol. 2", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Creedence Clearwater Revival"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ciao, Baby", Genre = genres["Rock"], Price = 8.99M, Artist = artists["TheStart"], AlbumArtUrl = imgUrl }, - new Album { Title = "Cidade Negra - Hits", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Cidade Negra"], AlbumArtUrl = imgUrl }, - new Album { Title = "Classic Munkle: Turbo Edition", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Munkle"], AlbumArtUrl = imgUrl }, - new Album { Title = "Classics: The Best of Sarah Brightman", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "Coda", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Come Away With Me", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Norah Jones"], AlbumArtUrl = imgUrl }, - new Album { Title = "Come Taste The Band", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Comfort Eagle", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Cake"], AlbumArtUrl = imgUrl }, - new Album { Title = "Common Reaction", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Uh Huh Her "], AlbumArtUrl = imgUrl }, - new Album { Title = "Compositores", Genre = genres["Rock"], Price = 8.99M, Artist = artists["O Terço"], AlbumArtUrl = imgUrl }, - new Album { Title = "Contraband", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Velvet Revolver"], AlbumArtUrl = imgUrl }, - new Album { Title = "Core", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Stone Temple Pilots"], AlbumArtUrl = imgUrl }, - new Album { Title = "Cornerstone", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Styx"], AlbumArtUrl = imgUrl }, - new Album { Title = "Cosmicolor", Genre = genres["Rap"], Price = 8.99M, Artist = artists["M-Flo"], AlbumArtUrl = imgUrl }, - new Album { Title = "Cross", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Justice"], AlbumArtUrl = imgUrl }, - new Album { Title = "Culture of Fear", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Thievery Corporation"], AlbumArtUrl = imgUrl }, - new Album { Title = "Da Lama Ao Caos", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Chico Science & Nação Zumbi"], AlbumArtUrl = imgUrl }, - new Album { Title = "Dakshina", Genre = genres["World"], Price = 8.99M, Artist = artists["Deva Premal"], AlbumArtUrl = imgUrl }, - new Album { Title = "Dark Side of the Moon", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pink Floyd"], AlbumArtUrl = imgUrl }, - new Album { Title = "Death Magnetic", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Deep End of Down", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Above the Fold"], AlbumArtUrl = imgUrl }, - new Album { Title = "Deep Purple In Rock", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Deixa Entrar", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Falamansa"], AlbumArtUrl = imgUrl }, - new Album { Title = "Deja Vu", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Crosby, Stills, Nash, and Young"], AlbumArtUrl = imgUrl }, - new Album { Title = "Di Korpu Ku Alma", Genre = genres["World"], Price = 8.99M, Artist = artists["Lura"], AlbumArtUrl = imgUrl }, - new Album { Title = "Diary of a Madman (Remastered)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Ozzy Osbourne"], AlbumArtUrl = imgUrl }, - new Album { Title = "Diary of a Madman", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Ozzy Osbourne"], AlbumArtUrl = imgUrl }, - new Album { Title = "Dirt", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Alice in Chains"], AlbumArtUrl = imgUrl }, - new Album { Title = "Diver Down", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Van Halen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Djavan Ao Vivo - Vol. 02", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Djavan"], AlbumArtUrl = imgUrl }, - new Album { Title = "Djavan Ao Vivo - Vol. 1", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Djavan"], AlbumArtUrl = imgUrl }, - new Album { Title = "Drum'n'bass for Papa", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Plug"], AlbumArtUrl = imgUrl }, - new Album { Title = "Duluth", Genre = genres["Country"], Price = 8.99M, Artist = artists["Trampled By Turtles"], AlbumArtUrl = imgUrl }, - new Album { Title = "Dummy", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Portishead"], AlbumArtUrl = imgUrl }, - new Album { Title = "Duos II", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Luciana Souza/Romero Lubambo"], AlbumArtUrl = imgUrl }, - new Album { Title = "Earl Scruggs and Friends", Genre = genres["Country"], Price = 8.99M, Artist = artists["Earl Scruggs"], AlbumArtUrl = imgUrl }, - new Album { Title = "Eden", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "El Camino", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Black Keys"], AlbumArtUrl = imgUrl }, - new Album { Title = "Elegant Gypsy", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Al di Meola"], AlbumArtUrl = imgUrl }, - new Album { Title = "Elements Of Life", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Tiësto"], AlbumArtUrl = imgUrl }, - new Album { Title = "Elis Regina-Minha História", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Elis Regina"], AlbumArtUrl = imgUrl }, - new Album { Title = "Emergency On Planet Earth", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Jamiroquai"], AlbumArtUrl = imgUrl }, - new Album { Title = "Emotion", Genre = genres["World"], Price = 8.99M, Artist = artists["Papa Wemba"], AlbumArtUrl = imgUrl }, - new Album { Title = "English Renaissance", Genre = genres["Classical"], Price = 8.99M, Artist = artists["The King's Singers"], AlbumArtUrl = imgUrl }, - new Album { Title = "Every Kind of Light", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Posies"], AlbumArtUrl = imgUrl }, - new Album { Title = "Faceless", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Godsmack"], AlbumArtUrl = imgUrl }, - new Album { Title = "Facelift", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Alice in Chains"], AlbumArtUrl = imgUrl }, - new Album { Title = "Fair Warning", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Van Halen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Fear of a Black Planet", Genre = genres["Rap"], Price = 8.99M, Artist = artists["Public Enemy"], AlbumArtUrl = imgUrl }, - new Album { Title = "Fear Of The Dark", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Feels Like Home", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Norah Jones"], AlbumArtUrl = imgUrl }, - new Album { Title = "Fireball", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Fly", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "For Those About To Rock We Salute You", Genre = genres["Rock"], Price = 8.99M, Artist = artists["AC/DC"], AlbumArtUrl = imgUrl }, - new Album { Title = "Four", Genre = genres["Blues"], Price = 8.99M, Artist = artists["Blues Traveler"], AlbumArtUrl = imgUrl }, - new Album { Title = "Frank", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Amy Winehouse"], AlbumArtUrl = imgUrl }, - new Album { Title = "Further Down the Spiral", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Nine Inch Nails"], AlbumArtUrl = imgUrl }, - new Album { Title = "Garage Inc. (Disc 1)", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Garage Inc. (Disc 2)", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Garbage", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Garbage"], AlbumArtUrl = imgUrl }, - new Album { Title = "Good News For People Who Love Bad News", Genre = genres["Indie"], Price = 8.99M, Artist = artists["Modest Mouse"], AlbumArtUrl = imgUrl }, - new Album { Title = "Gordon", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Barenaked Ladies"], AlbumArtUrl = imgUrl }, - new Album { Title = "Górecki: Symphony No. 3", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Adrian Leaper & Doreen de Feis"], AlbumArtUrl = imgUrl }, - new Album { Title = "Greatest Hits I", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Queen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Greatest Hits II", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Queen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Greatest Hits", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Duck Sauce"], AlbumArtUrl = imgUrl }, - new Album { Title = "Greatest Hits", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Lenny Kravitz"], AlbumArtUrl = imgUrl }, - new Album { Title = "Greatest Hits", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Lenny Kravitz"], AlbumArtUrl = imgUrl }, - new Album { Title = "Greatest Kiss", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Kiss"], AlbumArtUrl = imgUrl }, - new Album { Title = "Greetings from Michigan", Genre = genres["Indie"], Price = 8.99M, Artist = artists["Sufjan Stevens"], AlbumArtUrl = imgUrl }, - new Album { Title = "Group Therapy", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Above & Beyond"], AlbumArtUrl = imgUrl }, - new Album { Title = "Handel: The Messiah (Highlights)", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Scholars Baroque Ensemble"], AlbumArtUrl = imgUrl }, - new Album { Title = "Haydn: Symphonies 99 - 104", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Royal Philharmonic Orchestra"], AlbumArtUrl = imgUrl }, - new Album { Title = "Heart of the Night", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Spyro Gyra"], AlbumArtUrl = imgUrl }, - new Album { Title = "Heart On", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Eagles of Death Metal"], AlbumArtUrl = imgUrl }, - new Album { Title = "Holy Diver", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Dio"], AlbumArtUrl = imgUrl }, - new Album { Title = "Homework", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Daft Punk"], AlbumArtUrl = imgUrl }, - new Album { Title = "Hot Rocks, 1964-1971 (Disc 1)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Rolling Stones"], AlbumArtUrl = imgUrl }, - new Album { Title = "Houses Of The Holy", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "How To Dismantle An Atomic Bomb", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "Human", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Projected"], AlbumArtUrl = imgUrl }, - new Album { Title = "Hunky Dory", Genre = genres["Rock"], Price = 8.99M, Artist = artists["David Bowie"], AlbumArtUrl = imgUrl }, - new Album { Title = "Hymns", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Projected"], AlbumArtUrl = imgUrl }, - new Album { Title = "Hysteria", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Def Leppard"], AlbumArtUrl = imgUrl }, - new Album { Title = "In Absentia", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Porcupine Tree"], AlbumArtUrl = imgUrl }, - new Album { Title = "In Between", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Paul Van Dyk"], AlbumArtUrl = imgUrl }, - new Album { Title = "In Rainbows", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Radiohead"], AlbumArtUrl = imgUrl }, - new Album { Title = "In Step", Genre = genres["Blues"], Price = 8.99M, Artist = artists["Stevie Ray Vaughan & Double Trouble"], AlbumArtUrl = imgUrl }, - new Album { Title = "In the court of the Crimson King", Genre = genres["Rock"], Price = 8.99M, Artist = artists["King Crimson"], AlbumArtUrl = imgUrl }, - new Album { Title = "In Through The Out Door", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "In Your Honor [Disc 1]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Foo Fighters"], AlbumArtUrl = imgUrl }, - new Album { Title = "In Your Honor [Disc 2]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Foo Fighters"], AlbumArtUrl = imgUrl }, - new Album { Title = "Indestructible", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Rancid"], AlbumArtUrl = imgUrl }, - new Album { Title = "Infinity", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Journey"], AlbumArtUrl = imgUrl }, - new Album { Title = "Into The Light", Genre = genres["Rock"], Price = 8.99M, Artist = artists["David Coverdale"], AlbumArtUrl = imgUrl }, - new Album { Title = "Introspective", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Pet Shop Boys"], AlbumArtUrl = imgUrl }, - new Album { Title = "Iron Maiden", Genre = genres["Blues"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "ISAM", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Amon Tobin"], AlbumArtUrl = imgUrl }, - new Album { Title = "IV", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Jagged Little Pill", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Alanis Morissette"], AlbumArtUrl = imgUrl }, - new Album { Title = "Jagged Little Pill", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Alanis Morissette"], AlbumArtUrl = imgUrl }, - new Album { Title = "Jorge Ben Jor 25 Anos", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Jorge Ben"], AlbumArtUrl = imgUrl }, - new Album { Title = "Jota Quest-1995", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Jota Quest"], AlbumArtUrl = imgUrl }, - new Album { Title = "Kick", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["INXS"], AlbumArtUrl = imgUrl }, - new Album { Title = "Kill 'Em All", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Kind of Blue", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Miles Davis"], AlbumArtUrl = imgUrl }, - new Album { Title = "King For A Day Fool For A Lifetime", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Faith No More"], AlbumArtUrl = imgUrl }, - new Album { Title = "Kiss", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Carly Rae Jepsen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Last Call", Genre = genres["Country"], Price = 8.99M, Artist = artists["Cayouche"], AlbumArtUrl = imgUrl }, - new Album { Title = "Le Freak", Genre = genres["R&B"], Price = 8.99M, Artist = artists["Chic"], AlbumArtUrl = imgUrl }, - new Album { Title = "Le Tigre", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Le Tigre"], AlbumArtUrl = imgUrl }, - new Album { Title = "Led Zeppelin I", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Led Zeppelin II", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Led Zeppelin III", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Let There Be Rock", Genre = genres["Rock"], Price = 8.99M, Artist = artists["AC/DC"], AlbumArtUrl = imgUrl }, - new Album { Title = "Little Earthquakes", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Tori Amos"], AlbumArtUrl = imgUrl }, - new Album { Title = "Live [Disc 1]", Genre = genres["Blues"], Price = 8.99M, Artist = artists["The Black Crowes"], AlbumArtUrl = imgUrl }, - new Album { Title = "Live [Disc 2]", Genre = genres["Blues"], Price = 8.99M, Artist = artists["The Black Crowes"], AlbumArtUrl = imgUrl }, - new Album { Title = "Live After Death", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Live At Donington 1992 (Disc 1)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Live At Donington 1992 (Disc 2)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Live on Earth", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["The Cat Empire"], AlbumArtUrl = imgUrl }, - new Album { Title = "Live On Two Legs [Live]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pearl Jam"], AlbumArtUrl = imgUrl }, - new Album { Title = "Living After Midnight", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Judas Priest"], AlbumArtUrl = imgUrl }, - new Album { Title = "Living", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Paddy Casey"], AlbumArtUrl = imgUrl }, - new Album { Title = "Load", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Love Changes Everything", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "MacArthur Park Suite", Genre = genres["R&B"], Price = 8.99M, Artist = artists["Donna Summer"], AlbumArtUrl = imgUrl }, - new Album { Title = "Machine Head", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Magical Mystery Tour", Genre = genres["Pop"], Price = 8.99M, Artist = artists["The Beatles"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mais Do Mesmo", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Legião Urbana"], AlbumArtUrl = imgUrl }, - new Album { Title = "Maquinarama", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Skank"], AlbumArtUrl = imgUrl }, - new Album { Title = "Marasim", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Jagjit Singh"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mascagni: Cavalleria Rusticana", Genre = genres["Classical"], Price = 8.99M, Artist = artists["James Levine"], AlbumArtUrl = imgUrl }, - new Album { Title = "Master of Puppets", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mechanics & Mathematics", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Venus Hum"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mental Jewelry", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Live"], AlbumArtUrl = imgUrl }, - new Album { Title = "Metallics", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "meteora", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Linkin Park"], AlbumArtUrl = imgUrl }, - new Album { Title = "Meus Momentos", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Gonzaguinha"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mezmerize", Genre = genres["Metal"], Price = 8.99M, Artist = artists["System Of A Down"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mezzanine", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Massive Attack"], AlbumArtUrl = imgUrl }, - new Album { Title = "Miles Ahead", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Miles Davis"], AlbumArtUrl = imgUrl }, - new Album { Title = "Milton Nascimento Ao Vivo", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Milton Nascimento"], AlbumArtUrl = imgUrl }, - new Album { Title = "Minas", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Milton Nascimento"], AlbumArtUrl = imgUrl }, - new Album { Title = "Minha Historia", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Chico Buarque"], AlbumArtUrl = imgUrl }, - new Album { Title = "Misplaced Childhood", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Marillion"], AlbumArtUrl = imgUrl }, - new Album { Title = "MK III The Final Concerts [Disc 1]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Morning Dance", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Spyro Gyra"], AlbumArtUrl = imgUrl }, - new Album { Title = "Motley Crue Greatest Hits", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Mötley Crüe"], AlbumArtUrl = imgUrl }, - new Album { Title = "Moving Pictures", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Rush"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mozart: Chamber Music", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Nash Ensemble"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mozart: Symphonies Nos. 40 & 41", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Berliner Philharmoniker"], AlbumArtUrl = imgUrl }, - new Album { Title = "Murder Ballads", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Nick Cave and the Bad Seeds"], AlbumArtUrl = imgUrl }, - new Album { Title = "Music For The Jilted Generation", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["The Prodigy"], AlbumArtUrl = imgUrl }, - new Album { Title = "My Generation - The Very Best Of The Who", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Who"], AlbumArtUrl = imgUrl }, - new Album { Title = "My Name is Skrillex", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Skrillex"], AlbumArtUrl = imgUrl }, - new Album { Title = "Na Pista", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Cláudio Zoli"], AlbumArtUrl = imgUrl }, - new Album { Title = "Nevermind", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Nirvana"], AlbumArtUrl = imgUrl }, - new Album { Title = "New Adventures In Hi-Fi", Genre = genres["Rock"], Price = 8.99M, Artist = artists["R.E.M."], AlbumArtUrl = imgUrl }, - new Album { Title = "New Divide", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Linkin Park"], AlbumArtUrl = imgUrl }, - new Album { Title = "New York Dolls", Genre = genres["Punk"], Price = 8.99M, Artist = artists["New York Dolls"], AlbumArtUrl = imgUrl }, - new Album { Title = "News Of The World", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Queen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Nielsen: The Six Symphonies", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Göteborgs Symfoniker & Neeme Järvi"], AlbumArtUrl = imgUrl }, - new Album { Title = "Night At The Opera", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Queen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Night Castle", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Trans-Siberian Orchestra"], AlbumArtUrl = imgUrl }, - new Album { Title = "Nkolo", Genre = genres["World"], Price = 8.99M, Artist = artists["Lokua Kanza"], AlbumArtUrl = imgUrl }, - new Album { Title = "No More Tears (Remastered)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Ozzy Osbourne"], AlbumArtUrl = imgUrl }, - new Album { Title = "No Prayer For The Dying", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "No Security", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Rolling Stones"], AlbumArtUrl = imgUrl }, - new Album { Title = "O Brother, Where Art Thou?", Genre = genres["Country"], Price = 8.99M, Artist = artists["Alison Krauss"], AlbumArtUrl = imgUrl }, - new Album { Title = "O Samba Poconé", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Skank"], AlbumArtUrl = imgUrl }, - new Album { Title = "O(+>", Genre = genres["R&B"], Price = 8.99M, Artist = artists["Prince"], AlbumArtUrl = imgUrl }, - new Album { Title = "Oceania", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Smashing Pumpkins"], AlbumArtUrl = imgUrl }, - new Album { Title = "Off the Deep End", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Weird Al"], AlbumArtUrl = imgUrl }, - new Album { Title = "OK Computer", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Radiohead"], AlbumArtUrl = imgUrl }, - new Album { Title = "Olodum", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Olodum"], AlbumArtUrl = imgUrl }, - new Album { Title = "One Love", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["David Guetta"], AlbumArtUrl = imgUrl }, - new Album { Title = "Operation: Mindcrime", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Queensrÿche"], AlbumArtUrl = imgUrl }, - new Album { Title = "Opiate", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Tool"], AlbumArtUrl = imgUrl }, - new Album { Title = "Outbreak", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Dennis Chambers"], AlbumArtUrl = imgUrl }, - new Album { Title = "Pachelbel: Canon & Gigue", Genre = genres["Classical"], Price = 8.99M, Artist = artists["English Concert & Trevor Pinnock"], AlbumArtUrl = imgUrl }, - new Album { Title = "Paid in Full", Genre = genres["Rap"], Price = 8.99M, Artist = artists["Eric B. and Rakim"], AlbumArtUrl = imgUrl }, - new Album { Title = "Para Siempre", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Vicente Fernandez"], AlbumArtUrl = imgUrl }, - new Album { Title = "Pause", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Four Tet"], AlbumArtUrl = imgUrl }, - new Album { Title = "Peace Sells... but Who's Buying", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Megadeth"], AlbumArtUrl = imgUrl }, - new Album { Title = "Physical Graffiti [Disc 1]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Physical Graffiti [Disc 2]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Physical Graffiti", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Piece Of Mind", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Pinkerton", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Weezer"], AlbumArtUrl = imgUrl }, - new Album { Title = "Plays Metallica By Four Cellos", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Apocalyptica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Pop", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "Powerslave", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Prenda Minha", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Caetano Veloso"], AlbumArtUrl = imgUrl }, - new Album { Title = "Presence", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Pretty Hate Machine", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Nine Inch Nails"], AlbumArtUrl = imgUrl }, - new Album { Title = "Prisoner", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Jezabels"], AlbumArtUrl = imgUrl }, - new Album { Title = "Privateering", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Mark Knopfler"], AlbumArtUrl = imgUrl }, - new Album { Title = "Prokofiev: Romeo & Juliet", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Michael Tilson Thomas"], AlbumArtUrl = imgUrl }, - new Album { Title = "Prokofiev: Symphony No.1", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sergei Prokofiev & Yuri Temirkanov"], AlbumArtUrl = imgUrl }, - new Album { Title = "PSY's Best 6th Part 1", Genre = genres["Pop"], Price = 8.99M, Artist = artists["PSY"], AlbumArtUrl = imgUrl }, - new Album { Title = "Purcell: The Fairy Queen", Genre = genres["Classical"], Price = 8.99M, Artist = artists["London Classical Players"], AlbumArtUrl = imgUrl }, - new Album { Title = "Purpendicular", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Purple", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Stone Temple Pilots"], AlbumArtUrl = imgUrl }, - new Album { Title = "Quanta Gente Veio Ver (Live)", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Gilberto Gil"], AlbumArtUrl = imgUrl }, - new Album { Title = "Quanta Gente Veio ver--Bônus De Carnaval", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Gilberto Gil"], AlbumArtUrl = imgUrl }, - new Album { Title = "Quiet Songs", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Aisha Duo"], AlbumArtUrl = imgUrl }, - new Album { Title = "Raices", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Los Tigres del Norte"], AlbumArtUrl = imgUrl }, - new Album { Title = "Raising Hell", Genre = genres["Rap"], Price = 8.99M, Artist = artists["Run DMC"], AlbumArtUrl = imgUrl }, - new Album { Title = "Raoul and the Kings of Spain ", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Tears For Fears"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rattle And Hum", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "Raul Seixas", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Raul Seixas"], AlbumArtUrl = imgUrl }, - new Album { Title = "Recovery [Explicit]", Genre = genres["Rap"], Price = 8.99M, Artist = artists["Eminem"], AlbumArtUrl = imgUrl }, - new Album { Title = "Reign In Blood", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Slayer"], AlbumArtUrl = imgUrl }, - new Album { Title = "Relayed", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Yes"], AlbumArtUrl = imgUrl }, - new Album { Title = "ReLoad", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Respighi:Pines of Rome", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Eugene Ormandy"], AlbumArtUrl = imgUrl }, - new Album { Title = "Restless and Wild", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Accept"], AlbumArtUrl = imgUrl }, - new Album { Title = "Retrospective I (1974-1980)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Rush"], AlbumArtUrl = imgUrl }, - new Album { Title = "Revelations", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Audioslave"], AlbumArtUrl = imgUrl }, - new Album { Title = "Revolver", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Beatles"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ride the Lighting ", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ride The Lightning", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ring My Bell", Genre = genres["R&B"], Price = 8.99M, Artist = artists["Anita Ward"], AlbumArtUrl = imgUrl }, - new Album { Title = "Riot Act", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pearl Jam"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rise of the Phoenix", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Before the Dawn"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rock In Rio [CD1]", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rock In Rio [CD2]", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rock In Rio [CD2]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Roda De Funk", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Funk Como Le Gusta"], AlbumArtUrl = imgUrl }, - new Album { Title = "Room for Squares", Genre = genres["Pop"], Price = 8.99M, Artist = artists["John Mayer"], AlbumArtUrl = imgUrl }, - new Album { Title = "Root Down", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Jimmy Smith"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rounds", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Four Tet"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rubber Factory", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Black Keys"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rust in Peace", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Megadeth"], AlbumArtUrl = imgUrl }, - new Album { Title = "Sambas De Enredo 2001", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Various Artists"], AlbumArtUrl = imgUrl }, - new Album { Title = "Santana - As Years Go By", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Santana"], AlbumArtUrl = imgUrl }, - new Album { Title = "Santana Live", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Santana"], AlbumArtUrl = imgUrl }, - new Album { Title = "Saturday Night Fever", Genre = genres["R&B"], Price = 8.99M, Artist = artists["Bee Gees"], AlbumArtUrl = imgUrl }, - new Album { Title = "Scary Monsters and Nice Sprites", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Skrillex"], AlbumArtUrl = imgUrl }, - new Album { Title = "Scheherazade", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Chicago Symphony Orchestra & Fritz Reiner"], AlbumArtUrl = imgUrl }, - new Album { Title = "SCRIABIN: Vers la flamme", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Christopher O'Riley"], AlbumArtUrl = imgUrl }, - new Album { Title = "Second Coming", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Stone Roses"], AlbumArtUrl = imgUrl }, - new Album { Title = "Serie Sem Limite (Disc 1)", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Tim Maia"], AlbumArtUrl = imgUrl }, - new Album { Title = "Serie Sem Limite (Disc 2)", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Tim Maia"], AlbumArtUrl = imgUrl }, - new Album { Title = "Serious About Men", Genre = genres["Rap"], Price = 8.99M, Artist = artists["The Rubberbandits"], AlbumArtUrl = imgUrl }, - new Album { Title = "Seventh Son of a Seventh Son", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Short Bus", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Filter"], AlbumArtUrl = imgUrl }, - new Album { Title = "Sibelius: Finlandia", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Berliner Philharmoniker"], AlbumArtUrl = imgUrl }, - new Album { Title = "Singles Collection", Genre = genres["Rock"], Price = 8.99M, Artist = artists["David Bowie"], AlbumArtUrl = imgUrl }, - new Album { Title = "Six Degrees of Inner Turbulence", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Dream Theater"], AlbumArtUrl = imgUrl }, - new Album { Title = "Slave To The Empire", Genre = genres["Metal"], Price = 8.99M, Artist = artists["T&N"], AlbumArtUrl = imgUrl }, - new Album { Title = "Slaves And Masters", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Slouching Towards Bethlehem", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Robert James"], AlbumArtUrl = imgUrl }, - new Album { Title = "Smash", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Offspring"], AlbumArtUrl = imgUrl }, - new Album { Title = "Something Special", Genre = genres["Country"], Price = 8.99M, Artist = artists["Dolly Parton"], AlbumArtUrl = imgUrl }, - new Album { Title = "Somewhere in Time", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Song(s) You Know By Heart", Genre = genres["Country"], Price = 8.99M, Artist = artists["Jimmy Buffett"], AlbumArtUrl = imgUrl }, - new Album { Title = "Sound of Music", Genre = genres["Punk"], Price = 8.99M, Artist = artists["Adicts"], AlbumArtUrl = imgUrl }, - new Album { Title = "South American Getaway", Genre = genres["Classical"], Price = 8.99M, Artist = artists["The 12 Cellists of The Berlin Philharmonic"], AlbumArtUrl = imgUrl }, - new Album { Title = "Sozinho Remix Ao Vivo", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Caetano Veloso"], AlbumArtUrl = imgUrl }, - new Album { Title = "Speak of the Devil", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Ozzy Osbourne"], AlbumArtUrl = imgUrl }, - new Album { Title = "Spiritual State", Genre = genres["Rap"], Price = 8.99M, Artist = artists["Nujabes"], AlbumArtUrl = imgUrl }, - new Album { Title = "St. Anger", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Still Life", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Opeth"], AlbumArtUrl = imgUrl }, - new Album { Title = "Stop Making Sense", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Talking Heads"], AlbumArtUrl = imgUrl }, - new Album { Title = "Stormbringer", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Stranger than Fiction", Genre = genres["Punk"], Price = 8.99M, Artist = artists["Bad Religion"], AlbumArtUrl = imgUrl }, - new Album { Title = "Strauss: Waltzes", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Eugene Ormandy"], AlbumArtUrl = imgUrl }, - new Album { Title = "Supermodified", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Amon Tobin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Supernatural", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Santana"], AlbumArtUrl = imgUrl }, - new Album { Title = "Surfing with the Alien (Remastered)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Joe Satriani"], AlbumArtUrl = imgUrl }, - new Album { Title = "Switched-On Bach", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Wendy Carlos"], AlbumArtUrl = imgUrl }, - new Album { Title = "Symphony", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "Szymanowski: Piano Works, Vol. 1", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Martin Roscoe"], AlbumArtUrl = imgUrl }, - new Album { Title = "Tchaikovsky: The Nutcracker", Genre = genres["Classical"], Price = 8.99M, Artist = artists["London Symphony Orchestra"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ted Nugent", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Ted Nugent"], AlbumArtUrl = imgUrl }, - new Album { Title = "Teflon Don", Genre = genres["Rap"], Price = 8.99M, Artist = artists["Rick Ross"], AlbumArtUrl = imgUrl }, - new Album { Title = "Tell Another Joke at the Ol' Choppin' Block", Genre = genres["Indie"], Price = 8.99M, Artist = artists["Danielson Famile"], AlbumArtUrl = imgUrl }, - new Album { Title = "Temple of the Dog", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Temple of the Dog"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ten", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pearl Jam"], AlbumArtUrl = imgUrl }, - new Album { Title = "Texas Flood", Genre = genres["Blues"], Price = 8.99M, Artist = artists["Stevie Ray Vaughan"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Battle Rages On", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Beast Live", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Paul D'Ianno"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Best Of 1980-1990", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Best of 1990–2000", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Best of Beethoven", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Nicolaus Esterhazy Sinfonia"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Best Of Billy Cobham", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Billy Cobham"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Best of Ed Motta", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Ed Motta"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Best Of Van Halen, Vol. I", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Van Halen"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Bridge", Genre = genres["R&B"], Price = 8.99M, Artist = artists["Melanie Fiona"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Cage", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Tygers of Pan Tang"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Chicago Transit Authority", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Chicago "], AlbumArtUrl = imgUrl }, - new Album { Title = "The Chronic", Genre = genres["Rap"], Price = 8.99M, Artist = artists["Dr. Dre"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Colour And The Shape", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Foo Fighters"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Crane Wife", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["The Decemberists"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Cream Of Clapton", Genre = genres["Blues"], Price = 8.99M, Artist = artists["Eric Clapton"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Cure", Genre = genres["Pop"], Price = 8.99M, Artist = artists["The Cure"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Dark Side Of The Moon", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pink Floyd"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Divine Conspiracy", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Epica"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Doors", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Doors"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Dream of the Blue Turtles", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Sting"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Essential Miles Davis [Disc 1]", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Miles Davis"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Essential Miles Davis [Disc 2]", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Miles Davis"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Final Concerts (Disc 2)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Final Frontier", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Head and the Heart", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Head and the Heart"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Joshua Tree", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Last Night of the Proms", Genre = genres["Classical"], Price = 8.99M, Artist = artists["BBC Concert Orchestra"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Lumineers", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Lumineers"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Number of The Beast", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Number of The Beast", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Police Greatest Hits", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Police"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Song Remains The Same (Disc 1)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Song Remains The Same (Disc 2)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Southern Harmony and Musical Companion", Genre = genres["Blues"], Price = 8.99M, Artist = artists["The Black Crowes"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Spade", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Butch Walker & The Black Widows"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Stone Roses", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Stone Roses"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Suburbs", Genre = genres["Indie"], Price = 8.99M, Artist = artists["Arcade Fire"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Three Tenors Disc1/Disc2", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Carreras, Pavarotti, Domingo"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Trees They Grow So High", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Wall", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pink Floyd"], AlbumArtUrl = imgUrl }, - new Album { Title = "The X Factor", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Them Crooked Vultures", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Them Crooked Vultures"], AlbumArtUrl = imgUrl }, - new Album { Title = "This Is Happening", Genre = genres["Rock"], Price = 8.99M, Artist = artists["LCD Soundsystem"], AlbumArtUrl = imgUrl }, - new Album { Title = "Thunder, Lightning, Strike", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Go! Team"], AlbumArtUrl = imgUrl }, - new Album { Title = "Time to Say Goodbye", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "Time, Love & Tenderness", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Michael Bolton"], AlbumArtUrl = imgUrl }, - new Album { Title = "Tomorrow Starts Today", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Mobile"], AlbumArtUrl = imgUrl }, - new Album { Title = "Tribute", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Ozzy Osbourne"], AlbumArtUrl = imgUrl }, - new Album { Title = "Tuesday Night Music Club", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Sheryl Crow"], AlbumArtUrl = imgUrl }, - new Album { Title = "Umoja", Genre = genres["Rock"], Price = 8.99M, Artist = artists["BLØF"], AlbumArtUrl = imgUrl }, - new Album { Title = "Under the Pink", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Tori Amos"], AlbumArtUrl = imgUrl }, - new Album { Title = "Undertow", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Tool"], AlbumArtUrl = imgUrl }, - new Album { Title = "Un-Led-Ed", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Dread Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Unplugged [Live]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Kiss"], AlbumArtUrl = imgUrl }, - new Album { Title = "Unplugged", Genre = genres["Blues"], Price = 8.99M, Artist = artists["Eric Clapton"], AlbumArtUrl = imgUrl }, - new Album { Title = "Unplugged", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Eric Clapton"], AlbumArtUrl = imgUrl }, - new Album { Title = "Untrue", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Burial"], AlbumArtUrl = imgUrl }, - new Album { Title = "Use Your Illusion I", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Guns N' Roses"], AlbumArtUrl = imgUrl }, - new Album { Title = "Use Your Illusion II", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Guns N' Roses"], AlbumArtUrl = imgUrl }, - new Album { Title = "Use Your Illusion II", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Guns N' Roses"], AlbumArtUrl = imgUrl }, - new Album { Title = "Van Halen III", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Van Halen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Van Halen", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Van Halen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Version 2.0", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Garbage"], AlbumArtUrl = imgUrl }, - new Album { Title = "Vinicius De Moraes", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Vinícius De Moraes"], AlbumArtUrl = imgUrl }, - new Album { Title = "Virtual XI", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Voodoo Lounge", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Rolling Stones"], AlbumArtUrl = imgUrl }, - new Album { Title = "Vozes do MPB", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Various Artists"], AlbumArtUrl = imgUrl }, - new Album { Title = "Vs.", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pearl Jam"], AlbumArtUrl = imgUrl }, - new Album { Title = "Wagner: Favourite Overtures", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sir Georg Solti & Wiener Philharmoniker"], AlbumArtUrl = imgUrl }, - new Album { Title = "Walking Into Clarksdale", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Page & Plant"], AlbumArtUrl = imgUrl }, - new Album { Title = "Wapi Yo", Genre = genres["World"], Price = 8.99M, Artist = artists["Lokua Kanza"], AlbumArtUrl = imgUrl }, - new Album { Title = "War", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "Warner 25 Anos", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Antônio Carlos Jobim"], AlbumArtUrl = imgUrl }, - new Album { Title = "Wasteland R&Btheque", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Raunchy"], AlbumArtUrl = imgUrl }, - new Album { Title = "Watermark", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Enya"], AlbumArtUrl = imgUrl }, - new Album { Title = "We Were Exploding Anyway", Genre = genres["Rock"], Price = 8.99M, Artist = artists["65daysofstatic"], AlbumArtUrl = imgUrl }, - new Album { Title = "Weill: The Seven Deadly Sins", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Orchestre de l'Opéra de Lyon"], AlbumArtUrl = imgUrl }, - new Album { Title = "White Pony", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deftones"], AlbumArtUrl = imgUrl }, - new Album { Title = "Who's Next", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Who"], AlbumArtUrl = imgUrl }, - new Album { Title = "Wish You Were Here", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pink Floyd"], AlbumArtUrl = imgUrl }, - new Album { Title = "With Oden on Our Side", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Amon Amarth"], AlbumArtUrl = imgUrl }, - new Album { Title = "Worlds", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Aaron Goldberg"], AlbumArtUrl = imgUrl }, - new Album { Title = "Worship Music", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Anthrax"], AlbumArtUrl = imgUrl }, - new Album { Title = "X&Y", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Coldplay"], AlbumArtUrl = imgUrl }, - new Album { Title = "Xinti", Genre = genres["World"], Price = 8.99M, Artist = artists["Sara Tavares"], AlbumArtUrl = imgUrl }, - new Album { Title = "Yano", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Yano"], AlbumArtUrl = imgUrl }, - new Album { Title = "Yesterday Once More Disc 1/Disc 2", Genre = genres["Pop"], Price = 8.99M, Artist = artists["The Carpenters"], AlbumArtUrl = imgUrl }, - new Album { Title = "Zooropa", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "Zoso", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - }; - - foreach (var album in albums) - { - album.ArtistId = album.Artist.ArtistId; - album.GenreId = album.Genre.GenreId; - } - - return albums; - } - - private static Dictionary artists; - public static Dictionary Artists - { - get - { - if (artists == null) - { - var artistsList = new Artist[] - { - new Artist { Name = "65daysofstatic" }, - new Artist { Name = "Aaron Goldberg" }, - new Artist { Name = "Above & Beyond" }, - new Artist { Name = "Above the Fold" }, - new Artist { Name = "AC/DC" }, - new Artist { Name = "Accept" }, - new Artist { Name = "Adicts" }, - new Artist { Name = "Adrian Leaper & Doreen de Feis" }, - new Artist { Name = "Aerosmith" }, - new Artist { Name = "Aisha Duo" }, - new Artist { Name = "Al di Meola" }, - new Artist { Name = "Alabama Shakes" }, - new Artist { Name = "Alanis Morissette" }, - new Artist { Name = "Alberto Turco & Nova Schola Gregoriana" }, - new Artist { Name = "Alice in Chains" }, - new Artist { Name = "Alison Krauss" }, - new Artist { Name = "Amon Amarth" }, - new Artist { Name = "Amon Tobin" }, - new Artist { Name = "Amr Diab" }, - new Artist { Name = "Amy Winehouse" }, - new Artist { Name = "Anita Ward" }, - new Artist { Name = "Anthrax" }, - new Artist { Name = "Antônio Carlos Jobim" }, - new Artist { Name = "Apocalyptica" }, - new Artist { Name = "Aqua" }, - new Artist { Name = "Armand Van Helden" }, - new Artist { Name = "Arcade Fire" }, - new Artist { Name = "Audioslave" }, - new Artist { Name = "Bad Religion" }, - new Artist { Name = "Barenaked Ladies" }, - new Artist { Name = "BBC Concert Orchestra" }, - new Artist { Name = "Bee Gees" }, - new Artist { Name = "Before the Dawn" }, - new Artist { Name = "Berliner Philharmoniker" }, - new Artist { Name = "Billy Cobham" }, - new Artist { Name = "Black Label Society" }, - new Artist { Name = "Black Sabbath" }, - new Artist { Name = "BLØF" }, - new Artist { Name = "Blues Traveler" }, - new Artist { Name = "Boston Symphony Orchestra & Seiji Ozawa" }, - new Artist { Name = "Britten Sinfonia, Ivor Bolton & Lesley Garrett" }, - new Artist { Name = "Bruce Dickinson" }, - new Artist { Name = "Buddy Guy" }, - new Artist { Name = "Burial" }, - new Artist { Name = "Butch Walker & The Black Widows" }, - new Artist { Name = "Caetano Veloso" }, - new Artist { Name = "Cake" }, - new Artist { Name = "Calexico" }, - new Artist { Name = "Carly Rae Jepsen" }, - new Artist { Name = "Carreras, Pavarotti, Domingo" }, - new Artist { Name = "Cássia Eller" }, - new Artist { Name = "Cayouche" }, - new Artist { Name = "Chic" }, - new Artist { Name = "Chicago " }, - new Artist { Name = "Chicago Symphony Orchestra & Fritz Reiner" }, - new Artist { Name = "Chico Buarque" }, - new Artist { Name = "Chico Science & Nação Zumbi" }, - new Artist { Name = "Choir Of Westminster Abbey & Simon Preston" }, - new Artist { Name = "Chris Cornell" }, - new Artist { Name = "Christopher O'Riley" }, - new Artist { Name = "Cidade Negra" }, - new Artist { Name = "Cláudio Zoli" }, - new Artist { Name = "Coldplay" }, - new Artist { Name = "Creedence Clearwater Revival" }, - new Artist { Name = "Crosby, Stills, Nash, and Young" }, - new Artist { Name = "Daft Punk" }, - new Artist { Name = "Danielson Famile" }, - new Artist { Name = "David Bowie" }, - new Artist { Name = "David Coverdale" }, - new Artist { Name = "David Guetta" }, - new Artist { Name = "deadmau5" }, - new Artist { Name = "Deep Purple" }, - new Artist { Name = "Def Leppard" }, - new Artist { Name = "Deftones" }, - new Artist { Name = "Dennis Chambers" }, - new Artist { Name = "Deva Premal" }, - new Artist { Name = "Dio" }, - new Artist { Name = "Djavan" }, - new Artist { Name = "Dolly Parton" }, - new Artist { Name = "Donna Summer" }, - new Artist { Name = "Dr. Dre" }, - new Artist { Name = "Dread Zeppelin" }, - new Artist { Name = "Dream Theater" }, - new Artist { Name = "Duck Sauce" }, - new Artist { Name = "Earl Scruggs" }, - new Artist { Name = "Ed Motta" }, - new Artist { Name = "Edo de Waart & San Francisco Symphony" }, - new Artist { Name = "Elis Regina" }, - new Artist { Name = "Eminem" }, - new Artist { Name = "English Concert & Trevor Pinnock" }, - new Artist { Name = "Enya" }, - new Artist { Name = "Epica" }, - new Artist { Name = "Eric B. and Rakim" }, - new Artist { Name = "Eric Clapton" }, - new Artist { Name = "Eugene Ormandy" }, - new Artist { Name = "Faith No More" }, - new Artist { Name = "Falamansa" }, - new Artist { Name = "Filter" }, - new Artist { Name = "Foo Fighters" }, - new Artist { Name = "Four Tet" }, - new Artist { Name = "Frank Zappa & Captain Beefheart" }, - new Artist { Name = "Fretwork" }, - new Artist { Name = "Funk Como Le Gusta" }, - new Artist { Name = "Garbage" }, - new Artist { Name = "Gerald Moore" }, - new Artist { Name = "Gilberto Gil" }, - new Artist { Name = "Godsmack" }, - new Artist { Name = "Gonzaguinha" }, - new Artist { Name = "Göteborgs Symfoniker & Neeme Järvi" }, - new Artist { Name = "Guns N' Roses" }, - new Artist { Name = "Gustav Mahler" }, - new Artist { Name = "In This Moment" }, - new Artist { Name = "Incognito" }, - new Artist { Name = "INXS" }, - new Artist { Name = "Iron Maiden" }, - new Artist { Name = "Jagjit Singh" }, - new Artist { Name = "James Levine" }, - new Artist { Name = "Jamiroquai" }, - new Artist { Name = "Jimi Hendrix" }, - new Artist { Name = "Jimmy Buffett" }, - new Artist { Name = "Jimmy Smith" }, - new Artist { Name = "Joe Satriani" }, - new Artist { Name = "John Digweed" }, - new Artist { Name = "John Mayer" }, - new Artist { Name = "Jorge Ben" }, - new Artist { Name = "Jota Quest" }, - new Artist { Name = "Journey" }, - new Artist { Name = "Judas Priest" }, - new Artist { Name = "Julian Bream" }, - new Artist { Name = "Justice" }, - new Artist { Name = "Orchestre de l'Opéra de Lyon" }, - new Artist { Name = "King Crimson" }, - new Artist { Name = "Kiss" }, - new Artist { Name = "LCD Soundsystem" }, - new Artist { Name = "Le Tigre" }, - new Artist { Name = "Led Zeppelin" }, - new Artist { Name = "Legião Urbana" }, - new Artist { Name = "Lenny Kravitz" }, - new Artist { Name = "Les Arts Florissants & William Christie" }, - new Artist { Name = "Limp Bizkit" }, - new Artist { Name = "Linkin Park" }, - new Artist { Name = "Live" }, - new Artist { Name = "Lokua Kanza" }, - new Artist { Name = "London Symphony Orchestra" }, - new Artist { Name = "Los Tigres del Norte" }, - new Artist { Name = "Luciana Souza/Romero Lubambo" }, - new Artist { Name = "Lulu Santos" }, - new Artist { Name = "Lura" }, - new Artist { Name = "Marcos Valle" }, - new Artist { Name = "Marillion" }, - new Artist { Name = "Marisa Monte" }, - new Artist { Name = "Mark Knopfler" }, - new Artist { Name = "Martin Roscoe" }, - new Artist { Name = "Massive Attack" }, - new Artist { Name = "Maurizio Pollini" }, - new Artist { Name = "Megadeth" }, - new Artist { Name = "Mela Tenenbaum, Pro Musica Prague & Richard Kapp" }, - new Artist { Name = "Melanie Fiona" }, - new Artist { Name = "Men At Work" }, - new Artist { Name = "Metallica" }, - new Artist { Name = "M-Flo" }, - new Artist { Name = "Michael Bolton" }, - new Artist { Name = "Michael Tilson Thomas" }, - new Artist { Name = "Miles Davis" }, - new Artist { Name = "Milton Nascimento" }, - new Artist { Name = "Mobile" }, - new Artist { Name = "Modest Mouse" }, - new Artist { Name = "Mötley Crüe" }, - new Artist { Name = "Motörhead" }, - new Artist { Name = "Mumford & Sons" }, - new Artist { Name = "Munkle" }, - new Artist { Name = "Nash Ensemble" }, - new Artist { Name = "Neil Young" }, - new Artist { Name = "New York Dolls" }, - new Artist { Name = "Nick Cave and the Bad Seeds" }, - new Artist { Name = "Nicolaus Esterhazy Sinfonia" }, - new Artist { Name = "Nine Inch Nails" }, - new Artist { Name = "Nirvana" }, - new Artist { Name = "Norah Jones" }, - new Artist { Name = "Nujabes" }, - new Artist { Name = "O Terço" }, - new Artist { Name = "Oasis" }, - new Artist { Name = "Olodum" }, - new Artist { Name = "Opeth" }, - new Artist { Name = "Orchestra of The Age of Enlightenment" }, - new Artist { Name = "Os Paralamas Do Sucesso" }, - new Artist { Name = "Ozzy Osbourne" }, - new Artist { Name = "Paddy Casey" }, - new Artist { Name = "Page & Plant" }, - new Artist { Name = "Papa Wemba" }, - new Artist { Name = "Paul D'Ianno" }, - new Artist { Name = "Paul Oakenfold" }, - new Artist { Name = "Paul Van Dyk" }, - new Artist { Name = "Pearl Jam" }, - new Artist { Name = "Pet Shop Boys" }, - new Artist { Name = "Pink Floyd" }, - new Artist { Name = "Plug" }, - new Artist { Name = "Porcupine Tree" }, - new Artist { Name = "Portishead" }, - new Artist { Name = "Prince" }, - new Artist { Name = "Projected" }, - new Artist { Name = "PSY" }, - new Artist { Name = "Public Enemy" }, - new Artist { Name = "Queen" }, - new Artist { Name = "Queensrÿche" }, - new Artist { Name = "R.E.M." }, - new Artist { Name = "Radiohead" }, - new Artist { Name = "Rancid" }, - new Artist { Name = "Raul Seixas" }, - new Artist { Name = "Raunchy" }, - new Artist { Name = "Red Hot Chili Peppers" }, - new Artist { Name = "Rick Ross" }, - new Artist { Name = "Robert James" }, - new Artist { Name = "London Classical Players" }, - new Artist { Name = "Royal Philharmonic Orchestra" }, - new Artist { Name = "Run DMC" }, - new Artist { Name = "Rush" }, - new Artist { Name = "Santana" }, - new Artist { Name = "Sara Tavares" }, - new Artist { Name = "Sarah Brightman" }, - new Artist { Name = "Sasha" }, - new Artist { Name = "Scholars Baroque Ensemble" }, - new Artist { Name = "Scorpions" }, - new Artist { Name = "Sergei Prokofiev & Yuri Temirkanov" }, - new Artist { Name = "Sheryl Crow" }, - new Artist { Name = "Sir Georg Solti & Wiener Philharmoniker" }, - new Artist { Name = "Skank" }, - new Artist { Name = "Skrillex" }, - new Artist { Name = "Slash" }, - new Artist { Name = "Slayer" }, - new Artist { Name = "Soul-Junk" }, - new Artist { Name = "Soundgarden" }, - new Artist { Name = "Spyro Gyra" }, - new Artist { Name = "Stevie Ray Vaughan & Double Trouble" }, - new Artist { Name = "Stevie Ray Vaughan" }, - new Artist { Name = "Sting" }, - new Artist { Name = "Stone Temple Pilots" }, - new Artist { Name = "Styx" }, - new Artist { Name = "Sufjan Stevens" }, - new Artist { Name = "Supreme Beings of Leisure" }, - new Artist { Name = "System Of A Down" }, - new Artist { Name = "T&N" }, - new Artist { Name = "Talking Heads" }, - new Artist { Name = "Tears For Fears" }, - new Artist { Name = "Ted Nugent" }, - new Artist { Name = "Temple of the Dog" }, - new Artist { Name = "Terry Bozzio, Tony Levin & Steve Stevens" }, - new Artist { Name = "The 12 Cellists of The Berlin Philharmonic" }, - new Artist { Name = "The Axis of Awesome" }, - new Artist { Name = "The Beatles" }, - new Artist { Name = "The Black Crowes" }, - new Artist { Name = "The Black Keys" }, - new Artist { Name = "The Carpenters" }, - new Artist { Name = "The Cat Empire" }, - new Artist { Name = "The Cult" }, - new Artist { Name = "The Cure" }, - new Artist { Name = "The Decemberists" }, - new Artist { Name = "The Doors" }, - new Artist { Name = "The Eagles of Death Metal" }, - new Artist { Name = "The Go! Team" }, - new Artist { Name = "The Head and the Heart" }, - new Artist { Name = "The Jezabels" }, - new Artist { Name = "The King's Singers" }, - new Artist { Name = "The Lumineers" }, - new Artist { Name = "The Offspring" }, - new Artist { Name = "The Police" }, - new Artist { Name = "The Posies" }, - new Artist { Name = "The Prodigy" }, - new Artist { Name = "The Rolling Stones" }, - new Artist { Name = "The Rubberbandits" }, - new Artist { Name = "The Smashing Pumpkins" }, - new Artist { Name = "The Stone Roses" }, - new Artist { Name = "The Who" }, - new Artist { Name = "Them Crooked Vultures" }, - new Artist { Name = "TheStart" }, - new Artist { Name = "Thievery Corporation" }, - new Artist { Name = "Tiësto" }, - new Artist { Name = "Tim Maia" }, - new Artist { Name = "Ton Koopman" }, - new Artist { Name = "Tool" }, - new Artist { Name = "Tori Amos" }, - new Artist { Name = "Trampled By Turtles" }, - new Artist { Name = "Trans-Siberian Orchestra" }, - new Artist { Name = "Tygers of Pan Tang" }, - new Artist { Name = "U2" }, - new Artist { Name = "UB40" }, - new Artist { Name = "Uh Huh Her " }, - new Artist { Name = "Van Halen" }, - new Artist { Name = "Various Artists" }, - new Artist { Name = "Velvet Revolver" }, - new Artist { Name = "Venus Hum" }, - new Artist { Name = "Vicente Fernandez" }, - new Artist { Name = "Vinícius De Moraes" }, - new Artist { Name = "Weezer" }, - new Artist { Name = "Weird Al" }, - new Artist { Name = "Wendy Carlos" }, - new Artist { Name = "Wilhelm Kempff" }, - new Artist { Name = "Yano" }, - new Artist { Name = "Yehudi Menuhin" }, - new Artist { Name = "Yes" }, - new Artist { Name = "Yo-Yo Ma" }, - new Artist { Name = "Zeca Pagodinho" }, - new Artist { Name = "אריק אינשטיין"} - }; - - // TODO [EF] Swap to store generated keys when available - int artistId = 1; - artists = new Dictionary(); - foreach (Artist artist in artistsList) - { - artist.ArtistId = artistId++; - artists.Add(artist.Name, artist); - } - } - - return artists; - } - } - - private static Dictionary genres; - public static Dictionary Genres - { - get - { - if (genres == null) - { - var genresList = new Genre[] - { - new Genre { Name = "Pop" }, - new Genre { Name = "Rock" }, - new Genre { Name = "Jazz" }, - new Genre { Name = "Metal" }, - new Genre { Name = "Electronic" }, - new Genre { Name = "Blues" }, - new Genre { Name = "Latin" }, - new Genre { Name = "Rap" }, - new Genre { Name = "Classical" }, - new Genre { Name = "Alternative" }, - new Genre { Name = "Country" }, - new Genre { Name = "R&B" }, - new Genre { Name = "Indie" }, - new Genre { Name = "Punk" }, - new Genre { Name = "World" } - }; - - genres = new Dictionary(); - // TODO [EF] Swap to store generated keys when available - int genreId = 1; - foreach (Genre genre in genresList) - { - genre.GenreId = genreId++; - - // TODO [EF] Remove when null values are supported by update pipeline - genre.Description = genre.Name + " is great music (if you like it)."; - - genres.Add(genre.Name, genre); - } - } - - return genres; - } - } - } -} diff --git a/samples/angular/MusicStore/Apis/Models/SentimentAnalysis.cs b/samples/angular/MusicStore/Apis/Models/SentimentAnalysis.cs deleted file mode 100644 index 8167ec3d..00000000 --- a/samples/angular/MusicStore/Apis/Models/SentimentAnalysis.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Linq; -using System.Text.RegularExpressions; - -namespace MusicStore.Models -{ - // Obviously this is not a serious sentiment analyser. It is only here to provide an amusing demonstration of cross-property - // validation in AlbumsApiController. - public static class SentimentAnalysis - { - private static string[] positiveSentimentWords = new[] { "happy", "fun", "joy", "love", "delight", "bunny", "bunnies", "asp.net" }; - - private static string[] negativeSentimentWords = new[] { "sad", "pain", "despair", "hate", "scorn", "death", "package management" }; - - public static SentimentResult GetSentiment(string text) { - var numPositiveWords = CountWordOccurrences(text, positiveSentimentWords); - var numNegativeWords = CountWordOccurrences(text, negativeSentimentWords); - if (numPositiveWords > numNegativeWords) { - return SentimentResult.Positive; - } else if (numNegativeWords > numPositiveWords) { - return SentimentResult.Negative; - } else { - return SentimentResult.Neutral; - } - } - - private static int CountWordOccurrences(string text, string[] words) - { - // Very simplistic matching technique for this sample. Not scalable and not really even correct. - return new Regex(string.Join("|", words), RegexOptions.IgnoreCase).Matches(text).Count; - } - - public enum SentimentResult { - Negative, - Neutral, - Positive, - } - } -} diff --git a/samples/angular/MusicStore/Apis/Models/ShoppingCart.cs b/samples/angular/MusicStore/Apis/Models/ShoppingCart.cs deleted file mode 100644 index 1d2465ab..00000000 --- a/samples/angular/MusicStore/Apis/Models/ShoppingCart.cs +++ /dev/null @@ -1,207 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace MusicStore.Models -{ - public partial class ShoppingCart - { - MusicStoreContext _db; - string ShoppingCartId { get; set; } - - public ShoppingCart(MusicStoreContext db) - { - _db = db; - } - - public static ShoppingCart GetCart(MusicStoreContext db, HttpContext context) - { - var cart = new ShoppingCart(db); - cart.ShoppingCartId = cart.GetCartId(context); - return cart; - } - - public void AddToCart(Album album) - { - // Get the matching cart and album instances - var cartItem = _db.CartItems.SingleOrDefault( - c => c.CartId == ShoppingCartId - && c.AlbumId == album.AlbumId); - - if (cartItem == null) - { - // TODO [EF] Swap to store generated key once we support identity pattern - var nextCartItemId = _db.CartItems.Any() - ? _db.CartItems.Max(c => c.CartItemId) + 1 - : 1; - - // Create a new cart item if no cart item exists - cartItem = new CartItem - { - CartItemId = nextCartItemId, - AlbumId = album.AlbumId, - CartId = ShoppingCartId, - Count = 1, - DateCreated = DateTime.Now - }; - - _db.CartItems.Add(cartItem); - } - else - { - // If the item does exist in the cart, then add one to the quantity - cartItem.Count++; - - // TODO [EF] Remove this line once change detection is available - _db.Update(cartItem); - } - } - - public int RemoveFromCart(int id) - { - // Get the cart - var cartItem = _db.CartItems.Single( - cart => cart.CartId == ShoppingCartId - && cart.CartItemId == id); - - int itemCount = 0; - - if (cartItem != null) - { - if (cartItem.Count > 1) - { - cartItem.Count--; - - // TODO [EF] Remove this line once change detection is available - _db.Update(cartItem); - - itemCount = cartItem.Count; - } - else - { - _db.CartItems.Remove(cartItem); - } - } - - return itemCount; - } - - public void EmptyCart() - { - var cartItems = _db.CartItems.Where(cart => cart.CartId == ShoppingCartId); - - foreach (var cartItem in cartItems) - { - _db.Remove(cartItem); - } - } - - public List GetCartItems() - { - var cartItems = _db.CartItems.Where(cart => cart.CartId == ShoppingCartId).ToList(); - //TODO: Auto population of the related album data not available until EF feature is lighted up. - foreach (var cartItem in cartItems) - { - cartItem.Album = _db.Albums.Single(a => a.AlbumId == cartItem.AlbumId); - } - - return cartItems; - } - - public int GetCount() - { - // Get the count of each item in the cart and sum them up - int? count = (from cartItems in _db.CartItems - where cartItems.CartId == ShoppingCartId - select (int?)cartItems.Count).Sum(); - - // Return 0 if all entries are null - return count ?? 0; - } - - public decimal GetTotal() - { - // Multiply album price by count of that album to get - // the current price for each of those albums in the cart - // sum all album price totals to get the cart total - - // TODO Collapse to a single query once EF supports querying related data - decimal total = 0; - foreach (var item in _db.CartItems.Where(c => c.CartId == ShoppingCartId)) - { - var album = _db.Albums.Single(a => a.AlbumId == item.AlbumId); - total += item.Count * album.Price; - } - - return total; - } - - public int CreateOrder(Order order) - { - decimal orderTotal = 0; - - var cartItems = GetCartItems(); - - // TODO [EF] Swap to store generated identity key when supported - var nextId = _db.OrderDetails.Any() - ? _db.OrderDetails.Max(o => o.OrderDetailId) + 1 - : 1; - - // Iterate over the items in the cart, adding the order details for each - foreach (var item in cartItems) - { - //var album = _db.Albums.Find(item.AlbumId); - var album = _db.Albums.Single(a => a.AlbumId == item.AlbumId); - - var orderDetail = new OrderDetail - { - OrderDetailId = nextId, - AlbumId = item.AlbumId, - OrderId = order.OrderId, - UnitPrice = album.Price, - Quantity = item.Count, - }; - - // Set the order total of the shopping cart - orderTotal += (item.Count * album.Price); - - _db.OrderDetails.Add(orderDetail); - - nextId++; - } - - // Set the order's total to the orderTotal count - order.Total = orderTotal; - - // Empty the shopping cart - EmptyCart(); - - // Return the OrderId as the confirmation number - return order.OrderId; - } - - // We're using HttpContextBase to allow access to cookies. - public string GetCartId(HttpContext context) - { - var sessionCookie = context.Request.Cookies["Session"]; - string cartId = null; - - if (string.IsNullOrWhiteSpace(sessionCookie)) - { - //A GUID to hold the cartId. - cartId = Guid.NewGuid().ToString(); - - // Send cart Id as a cookie to the client. - context.Response.Cookies.Append("Session", cartId); - } - else - { - cartId = sessionCookie; - } - - return cartId; - } - } -} diff --git a/samples/angular/MusicStore/Controllers/HomeController.cs b/samples/angular/MusicStore/Controllers/HomeController.cs deleted file mode 100755 index 07e97022..00000000 --- a/samples/angular/MusicStore/Controllers/HomeController.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace MusicStore.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - - public IActionResult Error() - { - return View("~/Views/Shared/Error.cshtml"); - } - } -} diff --git a/samples/angular/MusicStore/Infrastructure/NoCacheAttribute.cs b/samples/angular/MusicStore/Infrastructure/NoCacheAttribute.cs deleted file mode 100644 index 856023a8..00000000 --- a/samples/angular/MusicStore/Infrastructure/NoCacheAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using System; -using Microsoft.AspNetCore.Mvc.Filters; - -namespace MusicStore.Infrastructure -{ - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] - public sealed class NoCacheAttribute : ActionFilterAttribute - { - public override void OnResultExecuting(ResultExecutingContext context) - { - context.HttpContext.Response.Headers["Cache-Control"] = "no-cache, no-store, max-age=0"; - context.HttpContext.Response.Headers["Pragma"] = "no-cache"; - context.HttpContext.Response.Headers["Expires"] = "-1"; - - base.OnResultExecuting(context); - } - } -} diff --git a/samples/angular/MusicStore/Infrastructure/PagedList.cs b/samples/angular/MusicStore/Infrastructure/PagedList.cs deleted file mode 100644 index b2cb2c57..00000000 --- a/samples/angular/MusicStore/Infrastructure/PagedList.cs +++ /dev/null @@ -1,150 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace MusicStore.Infrastructure -{ - public interface IPagedList - { - IEnumerable Data { get; } - - int Page { get; } - - int PageSize { get; } - - int TotalCount { get; } - } - - internal class PagedList : IPagedList - { - public PagedList(IEnumerable data, int page, int pageSize, int totalCount) - { - Data = data; - Page = page; - PageSize = pageSize; - TotalCount = totalCount; - } - - public IEnumerable Data { get; private set; } - - public int Page { get; private set; } - - public int PageSize { get; private set; } - - public int TotalCount { get; private set; } - } - - public static class PagedListExtensions - { - public static IPagedList ToPagedList(this IQueryable query, int page, int pageSize) - { - if (query == null) - { - throw new ArgumentNullException("query"); - } - - var pagingConfig = new PagingConfig(page, pageSize); - var skipCount = ValidatePagePropertiesAndGetSkipCount(pagingConfig); - - var data = query - .Skip(skipCount) - .Take(pagingConfig.PageSize) - .ToList(); - - if (skipCount > 0 && data.Count == 0) - { - // Requested page has no records, just return the first page - pagingConfig.Page = 1; - data = query - .Take(pagingConfig.PageSize) - .ToList(); - } - - return new PagedList(data, pagingConfig.Page, pagingConfig.PageSize, query.Count()); - } - - public static Task> ToPagedListAsync(this IQueryable query, int page, int pageSize, string sortExpression, Expression> defaultSortExpression, SortDirection defaultSortDirection = SortDirection.Ascending) - where TModel : class - { - return ToPagedListAsync(query, page, pageSize, sortExpression, defaultSortExpression, defaultSortDirection, null); - } - - public static async Task> ToPagedListAsync(this IQueryable query, int page, int pageSize, string sortExpression, Expression> defaultSortExpression, SortDirection defaultSortDirection, Func selector) - where TModel : class - where TResult : class - { - if (query == null) - { - throw new ArgumentNullException("query"); - } - - var pagingConfig = new PagingConfig(page, pageSize); - var skipCount = ValidatePagePropertiesAndGetSkipCount(pagingConfig); - var dataQuery = query; - - if (defaultSortExpression != null) - { - dataQuery = dataQuery - .SortBy(sortExpression, defaultSortExpression); - } - - var data = await dataQuery - .Skip(skipCount) - .Take(pagingConfig.PageSize) - .ToListAsync(); - - if (skipCount > 0 && data.Count == 0) - { - // Requested page has no records, just return the first page - pagingConfig.Page = 1; - data = await dataQuery - .Take(pagingConfig.PageSize) - .ToListAsync(); - } - - var count = await query.CountAsync(); - - var resultData = selector != null - ? data.Select(selector) - : data.Cast(); - - return new PagedList(resultData, pagingConfig.Page, pagingConfig.PageSize, count); - } - - private static int ValidatePagePropertiesAndGetSkipCount(PagingConfig pagingConfig) - { - if (pagingConfig.Page < 1) - { - pagingConfig.Page = 1; - } - - if (pagingConfig.PageSize < 10) - { - pagingConfig.PageSize = 10; - } - - if (pagingConfig.PageSize > 100) - { - pagingConfig.PageSize = 100; - } - - return pagingConfig.PageSize * (pagingConfig.Page - 1); - } - - internal class PagingConfig - { - public PagingConfig(int page, int pageSize) - { - Page = page; - PageSize = pageSize; - } - - public int Page { get; set; } - - public int PageSize { get; set; } - } - } -} diff --git a/samples/angular/MusicStore/Infrastructure/SortDirection.cs b/samples/angular/MusicStore/Infrastructure/SortDirection.cs deleted file mode 100644 index 28f7e86c..00000000 --- a/samples/angular/MusicStore/Infrastructure/SortDirection.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace MusicStore.Infrastructure -{ - public enum SortDirection - { - Ascending, - Descending - } -} diff --git a/samples/angular/MusicStore/Infrastructure/SortExpression.cs b/samples/angular/MusicStore/Infrastructure/SortExpression.cs deleted file mode 100644 index 88ba312c..00000000 --- a/samples/angular/MusicStore/Infrastructure/SortExpression.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.ViewFeatures.Internal; - -namespace MusicStore.Infrastructure -{ - public static class SortExpression - { - private const string SORT_DIRECTION_DESC = " DESC"; - - public static IQueryable SortBy(this IQueryable query, string sortExpression, Expression> defaultSortExpression, SortDirection defaultSortDirection = SortDirection.Ascending) where TModel : class - { - return SortBy(query, sortExpression ?? Create(defaultSortExpression, defaultSortDirection)); - } - - public static string Create(Expression> expression, SortDirection sortDirection = SortDirection.Ascending) where TModel : class - { - var expressionText = ExpressionHelper.GetExpressionText(expression); - // TODO: Validate the expression depth, etc. - - var sortExpression = expressionText; - - if (sortDirection == SortDirection.Descending) - { - sortExpression += SORT_DIRECTION_DESC; - } - - return sortExpression; - } - - public static IQueryable SortBy(this IQueryable source, string sortExpression) where T : class - { - if (source == null) - { - throw new ArgumentNullException("source"); - } - - if (String.IsNullOrWhiteSpace(sortExpression)) - { - return source; - } - - sortExpression = sortExpression.Trim(); - var isDescending = false; - - // DataSource control passes the sort parameter with a direction - // if the direction is descending - if (sortExpression.EndsWith(SORT_DIRECTION_DESC, StringComparison.OrdinalIgnoreCase)) - { - isDescending = true; - var descIndex = sortExpression.Length - SORT_DIRECTION_DESC.Length; - sortExpression = sortExpression.Substring(0, descIndex).Trim(); - } - - if (string.IsNullOrEmpty(sortExpression)) - { - return source; - } - - ParameterExpression parameter = Expression.Parameter(source.ElementType, String.Empty); - - // Build up the property expression, e.g.: (m => m.Foo.Bar) - var sortExpressionParts = sortExpression.Split('.'); - Expression propertyExpression = parameter; - foreach (var property in sortExpressionParts) - { - propertyExpression = Expression.Property(propertyExpression, property); - } - - LambdaExpression lambda = Expression.Lambda(propertyExpression, parameter); - - var methodName = (isDescending) ? "OrderByDescending" : "OrderBy"; - - Expression methodCallExpression = Expression.Call( - typeof(Queryable), - methodName, - new[] { source.ElementType, propertyExpression.Type }, - source.Expression, - Expression.Quote(lambda)); - - return (IQueryable)source.Provider.CreateQuery(methodCallExpression); - } - } -} diff --git a/samples/angular/MusicStore/MusicStore.xproj b/samples/angular/MusicStore/MusicStore.xproj deleted file mode 100644 index 93efb5ea..00000000 --- a/samples/angular/MusicStore/MusicStore.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - true - - - - 1a74148f-9dc0-435d-b5ac-7d1b0d3d5e0b - MusicStore - ..\artifacts\obj\$(MSBuildProjectName) - .\bin\ - - - 2.0 - 5068 - - - \ No newline at end of file diff --git a/samples/angular/MusicStore/Startup.cs b/samples/angular/MusicStore/Startup.cs deleted file mode 100755 index 3d5e2636..00000000 --- a/samples/angular/MusicStore/Startup.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.PlatformAbstractions; -using AutoMapper; -using MusicStore.Apis; -using MusicStore.Models; - -namespace MusicStore -{ - public class Startup - { - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc().AddJsonOptions(options => - { - options.SerializerSettings.ContractResolver = null; - }); - - // Add EF services to the service container - services.AddEntityFramework() - .AddEntityFrameworkSqlite() - .AddDbContext(options => { - options.UseSqlite("Data Source=music-db.sqlite"); - }); - - // Add Identity services to the services container - services.AddIdentity() - .AddEntityFrameworkStores() - .AddDefaultTokenProviders(); - - // Configure Auth - services.Configure(options => - { - options.AddPolicy("app-ManageStore", new AuthorizationPolicyBuilder().RequireClaim("app-ManageStore", "Allowed").Build()); - }); - - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHostingEnvironment env) - { - app.UseDeveloperExceptionPage(); - - // Initialize the sample data - SampleData.InitializeMusicStoreDatabaseAsync(app.ApplicationServices).Wait(); - - app.UseStaticFiles(); - loggerFactory.AddConsole(); - - // Add MVC to the request pipeline. - app.UseMvc(routes => - { - // Matches requests that correspond to an existent controller/action pair - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - - // Matches any other request that doesn't appear to have a filename extension (defined as 'having a dot in the last URI segment'). - // This means you'll correctly get 404s for /some/dir/non-existent-image.png instead of returning the SPA HTML. - // However, it means requests like /customers/isaac.newton will *not* be mapped into the SPA, so if you need to accept - // URIs like that you'll need to match all URIs, e.g.: - // routes.MapRoute("spa-fallback", "{*anything}", new { controller = "Home", action = "Index" }); - // (which of course will match /customers/isaac.png too, so in that case it would serve the PNG image at that URL if one is on disk, - // or the SPA HTML if not). - routes.MapSpaFallbackRoute("spa-fallback", new { controller = "Home", action = "Index" }); - }); - } - - public static void Main(string[] args) - { - var host = new WebHostBuilder() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseKestrel() - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/samples/angular/MusicStore/Views/Home/Index.cshtml b/samples/angular/MusicStore/Views/Home/Index.cshtml deleted file mode 100755 index 9ac9f01a..00000000 --- a/samples/angular/MusicStore/Views/Home/Index.cshtml +++ /dev/null @@ -1,23 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - - - Loading... - @await Html.PrimeCache(Url.Action("GenreMenuList", "GenresApi")) - @await Html.PrimeCache(Url.Action("MostPopular", "AlbumsApi")) - - -@section scripts { - - - - - - - - - - - -} diff --git a/samples/angular/MusicStore/Views/Shared/Error.cshtml b/samples/angular/MusicStore/Views/Shared/Error.cshtml deleted file mode 100755 index 473b35d6..00000000 --- a/samples/angular/MusicStore/Views/Shared/Error.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ViewData["Title"] = "Error"; -} - -

Error.

-

An error occurred while processing your request.

diff --git a/samples/angular/MusicStore/Views/Shared/_Layout.cshtml b/samples/angular/MusicStore/Views/Shared/_Layout.cshtml deleted file mode 100755 index 562ccf83..00000000 --- a/samples/angular/MusicStore/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Music Store - - - - - - - - - - - - - @RenderBody() - - - - - - - - - - - @RenderSection("scripts", required: false) - - diff --git a/samples/angular/MusicStore/Views/_ViewImports.cshtml b/samples/angular/MusicStore/Views/_ViewImports.cshtml deleted file mode 100755 index 3e7a43a3..00000000 --- a/samples/angular/MusicStore/Views/_ViewImports.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@using MusicStore -@using Microsoft.AspNetCore.AngularServices -@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" -@addTagHelper "*, Microsoft.AspNetCore.SpaServices" diff --git a/samples/angular/MusicStore/Views/_ViewStart.cshtml b/samples/angular/MusicStore/Views/_ViewStart.cshtml deleted file mode 100755 index 820a2f6e..00000000 --- a/samples/angular/MusicStore/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/samples/angular/MusicStore/gulpfile.js b/samples/angular/MusicStore/gulpfile.js deleted file mode 100755 index 215f9932..00000000 --- a/samples/angular/MusicStore/gulpfile.js +++ /dev/null @@ -1,53 +0,0 @@ -/// - -"use strict"; - -var path = require('path'); -var gulp = require('gulp'); -var del = require('del'); -var typescript = require('gulp-typescript'); -var inlineNg2Template = require('gulp-inline-ng2-template'); -var sourcemaps = require('gulp-sourcemaps'); - -var webroot = "./wwwroot/"; - -var config = { - libBase: 'node_modules', - lib: [ - require.resolve('bootstrap/dist/css/bootstrap.css'), - path.dirname(require.resolve('bootstrap/dist/fonts/glyphicons-halflings-regular.woff')) + '/**', - require.resolve('angular2/bundles/angular2-polyfills.js'), - require.resolve('traceur/bin/traceur-runtime.js'), - require.resolve('es6-module-loader/dist/es6-module-loader-sans-promises.js'), - require.resolve('systemjs/dist/system.src.js'), - require.resolve('angular2/bundles/angular2.dev.js'), - require.resolve('angular2/bundles/router.dev.js'), - require.resolve('angular2/bundles/http.dev.js'), - require.resolve('angular2-aspnet/bundles/angular2-aspnet.js'), - require.resolve('jquery/dist/jquery.js'), - require.resolve('bootstrap/dist/js/bootstrap.js'), - require.resolve('rxjs/bundles/Rx.js') - ] -}; - -gulp.task('build.lib', function () { - return gulp.src(config.lib, { base: config.libBase }) - .pipe(gulp.dest(webroot + 'lib')); -}); - -gulp.task('build', ['build.lib'], function () { - var tsProject = typescript.createProject('./tsconfig.json', { typescript: require('typescript') }); - var tsSrcInlined = gulp.src([webroot + '**/*.ts', 'typings/**/*.d.ts'], { base: webroot }) - .pipe(inlineNg2Template({ base: webroot })); - return tsSrcInlined - .pipe(sourcemaps.init()) - .pipe(typescript(tsProject)) - .pipe(sourcemaps.write()) - .pipe(gulp.dest(webroot)); -}); - -gulp.task('clean', function () { - return del([webroot + 'lib']); -}); - -gulp.task('default', ['build']); diff --git a/samples/angular/MusicStore/package.json b/samples/angular/MusicStore/package.json deleted file mode 100644 index 1fa631e3..00000000 --- a/samples/angular/MusicStore/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "MusicStore", - "version": "0.0.0", - "dependencies": { - "angular2": "2.0.0-beta.15", - "angular2-aspnet": "^0.0.6", - "angular2-universal": "0.98.1", - "aspnet-prerendering": "^1.0.1", - "bootstrap": "^3.3.5", - "css": "^2.2.1", - "es6-module-loader": "0.15.0", - "es6-shim": "^0.35.0", - "isomorphic-fetch": "^2.2.1", - "jquery": "^2.1.4", - "less": "^2.5.3", - "preboot": "2.0.5", - "rxjs": "5.0.0-beta.2", - "systemjs": "^0.19.3", - "traceur": "0.0.106", - "zone.js": "^0.6.10" - }, - "devDependencies": { - "del": "^2.0.2", - "gulp": "^3.9.0", - "gulp-inline-ng2-template": "0.0.7", - "gulp-sourcemaps": "^1.6.0", - "gulp-typescript": "^2.9.0", - "typescript": "^1.6.2" - } -} diff --git a/samples/angular/MusicStore/project.json b/samples/angular/MusicStore/project.json deleted file mode 100755 index d341cf13..00000000 --- a/samples/angular/MusicStore/project.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "runtimeOptions": { - "gcServer": true - }, - "tooling": { - "defaultNamespace": "MusicStore" - }, - -"dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.0", - "type": "platform" - }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0", - "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", - "Microsoft.AspNetCore.Mvc": "1.0.0", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", - "Microsoft.AspNetCore.StaticFiles": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Logging.Console": "1.0.0", - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.Extensions.Logging.Debug": "1.0.0", - "Microsoft.EntityFrameworkCore.SQLite": "1.0.0", - "Microsoft.AspNetCore.AngularServices": "1.0.0-*", - "AutoMapper": "4.1.1" - }, - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "dotnet5.6", - "dnxcore50", - "portable-net45+win8" - ] - } - }, - "publishOptions": { - "exclude": [ - "node_modules", - "bower_components", - "**.xproj", - "**.user", - "**.vspscc" - ] - }, - "scripts": { - "prepublish": [ "npm install" ], - "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] - } -} diff --git a/samples/angular/MusicStore/tsconfig.json b/samples/angular/MusicStore/tsconfig.json deleted file mode 100644 index a4c5eeb7..00000000 --- a/samples/angular/MusicStore/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es5", - "sourceMap": false, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "noLib": false - }, - "exclude": [ - "node_modules" - ] -} diff --git a/samples/angular/MusicStore/tsd.json b/samples/angular/MusicStore/tsd.json deleted file mode 100644 index dc2f9671..00000000 --- a/samples/angular/MusicStore/tsd.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "v4", - "repo": "borisyankov/DefinitelyTyped", - "ref": "master", - "path": "typings", - "bundle": "typings/tsd.d.ts", - "installed": { - "es6-shim/es6-shim.d.ts": { - "commit": "ec9eb4b28c74665a602c22db3457f0a76fa0fa23" - } - } -} diff --git a/samples/angular/MusicStore/typings/es6-shim/es6-shim.d.ts b/samples/angular/MusicStore/typings/es6-shim/es6-shim.d.ts deleted file mode 100644 index 1c3df0ed..00000000 --- a/samples/angular/MusicStore/typings/es6-shim/es6-shim.d.ts +++ /dev/null @@ -1,668 +0,0 @@ -// Type definitions for es6-shim v0.31.2 -// Project: https://github.com/paulmillr/es6-shim -// Definitions by: Ron Buckton -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare type PropertyKey = string | number | symbol; - -interface IteratorResult { - done: boolean; - value?: T; -} - -interface IterableShim { - /** - * Shim for an ES6 iterable. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): Iterator; -} - -interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} - -interface IterableIteratorShim extends IterableShim, Iterator { - /** - * Shim for an ES6 iterable iterator. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): IterableIteratorShim; -} - -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 String { - /** - * 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. - */ - includes(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 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; - - /** - * Shim for an ES6 iterable. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): IterableIteratorShim; -} - -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: IterableShim, 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: IterableShim): 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 Array { - /** - * 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[]; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIteratorShim<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIteratorShim; - - /** - * Returns an list of values in the array - */ - values(): IterableIteratorShim; - - /** - * Shim for an ES6 iterable. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): IterableIteratorShim; -} - -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 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 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. - * @remarks Requires `__proto__` support. - */ - setPrototypeOf(o: any, proto: any): any; -} - -interface RegExp { - /** - * 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; -} - -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; -} - -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; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): 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; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): 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; - catch(onrejected?: (reason: any) => void): Promise; -} - -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: IterableShim>): 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: IterableShim>): 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; -} - -declare var Promise: PromiseConstructor; - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): Map; - size: number; - entries(): IterableIteratorShim<[K, V]>; - keys(): IterableIteratorShim; - values(): IterableIteratorShim; -} - -interface MapConstructor { - new (): Map; - new (iterable: IterableShim<[K, V]>): Map; - prototype: Map; -} - -declare var Map: MapConstructor; - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; - entries(): IterableIteratorShim<[T, T]>; - keys(): IterableIteratorShim; - values(): IterableIteratorShim; -} - -interface SetConstructor { - new (): Set; - new (iterable: IterableShim): Set; - prototype: Set; -} - -declare var Set: SetConstructor; - -interface WeakMap { - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): WeakMap; -} - -interface WeakMapConstructor { - new (): WeakMap; - new (iterable: IterableShim<[K, V]>): WeakMap; - prototype: WeakMap; -} - -declare var WeakMap: WeakMapConstructor; - -interface WeakSet { - add(value: T): WeakSet; - delete(value: T): boolean; - has(value: T): boolean; -} - -interface WeakSetConstructor { - new (): WeakSet; - new (iterable: IterableShim): WeakSet; - prototype: WeakSet; -} - -declare var WeakSet: WeakSetConstructor; - -declare namespace 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): IterableIteratorShim; - 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: PropertyKey): 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; -} - -declare module "es6-shim" { - var String: StringConstructor; - var Array: ArrayConstructor; - var Number: NumberConstructor; - var Math: Math; - var Object: ObjectConstructor; - var Map: MapConstructor; - var Set: SetConstructor; - var WeakMap: WeakMapConstructor; - var WeakSet: WeakSetConstructor; - var Promise: PromiseConstructor; - namespace 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): Iterator; - 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: PropertyKey): 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; - } -} diff --git a/samples/angular/MusicStore/typings/tsd.d.ts b/samples/angular/MusicStore/typings/tsd.d.ts deleted file mode 100644 index 8b614f9a..00000000 --- a/samples/angular/MusicStore/typings/tsd.d.ts +++ /dev/null @@ -1,2 +0,0 @@ - -/// diff --git a/samples/angular/MusicStore/typings/url-workaround.d.ts b/samples/angular/MusicStore/typings/url-workaround.d.ts deleted file mode 100644 index 9d167602..00000000 --- a/samples/angular/MusicStore/typings/url-workaround.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file is a workaround for angular2-universal-preview version 0.84.2 relying on the declaration of -// Node's 'url' module. Ideally it would not declare dependencies on Node APIs except where it also supplies -// the definitions itself. - -declare module 'url' { - export interface Url {} -} diff --git a/samples/angular/MusicStore/wwwroot/css/site.css b/samples/angular/MusicStore/wwwroot/css/site.css deleted file mode 100644 index 952e03fb..00000000 --- a/samples/angular/MusicStore/wwwroot/css/site.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - padding-top: 50px; -} diff --git a/samples/angular/MusicStore/wwwroot/css/styles.less b/samples/angular/MusicStore/wwwroot/css/styles.less deleted file mode 100644 index 564f8f40..00000000 --- a/samples/angular/MusicStore/wwwroot/css/styles.less +++ /dev/null @@ -1,14 +0,0 @@ -@base: #f938ab; - -.box-shadow(@style, @c) when (iscolor(@c)) { - -webkit-box-shadow: @style @c; - box-shadow: @style @c; -} -.box-shadow(@style, @alpha: 50%) when (isnumber(@alpha)) { - .box-shadow(@style, rgba(0, 0, 0, @alpha)); -} -.box { - color: saturate(@base, 5%); - border-color: lighten(@base, 30%); - div { .box-shadow(0 0 5px, 30%) } -} diff --git a/samples/angular/MusicStore/wwwroot/images/home-showcase.png b/samples/angular/MusicStore/wwwroot/images/home-showcase.png deleted file mode 100644 index 258c19d3..00000000 Binary files a/samples/angular/MusicStore/wwwroot/images/home-showcase.png and /dev/null differ diff --git a/samples/angular/MusicStore/wwwroot/images/logo.png b/samples/angular/MusicStore/wwwroot/images/logo.png deleted file mode 100644 index d334c862..00000000 Binary files a/samples/angular/MusicStore/wwwroot/images/logo.png and /dev/null differ diff --git a/samples/angular/MusicStore/wwwroot/images/placeholder.png b/samples/angular/MusicStore/wwwroot/images/placeholder.png deleted file mode 100644 index 1f73dbb4..00000000 Binary files a/samples/angular/MusicStore/wwwroot/images/placeholder.png and /dev/null differ diff --git a/samples/angular/MusicStore/wwwroot/ng-app/boot-client.ts b/samples/angular/MusicStore/wwwroot/ng-app/boot-client.ts deleted file mode 100644 index 65e24a06..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/boot-client.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { bootstrap } from 'angular2/platform/browser'; -import { FormBuilder } from 'angular2/common'; -import * as router from 'angular2/router'; -import { Http, HTTP_PROVIDERS } from 'angular2/http'; -import { CACHE_PRIMED_HTTP_PROVIDERS } from 'angular2-aspnet'; -import { App } from './components/app/app'; - -bootstrap(App, [router.ROUTER_BINDINGS, HTTP_PROVIDERS, CACHE_PRIMED_HTTP_PROVIDERS, FormBuilder]); diff --git a/samples/angular/MusicStore/wwwroot/ng-app/boot-server.ts b/samples/angular/MusicStore/wwwroot/ng-app/boot-server.ts deleted file mode 100644 index 10578a13..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/boot-server.ts +++ /dev/null @@ -1,30 +0,0 @@ -import 'angular2-universal/polyfills'; -import { FormBuilder } from 'angular2/common'; -import * as ngCore from 'angular2/core'; -import * as ngRouter from 'angular2/router'; -import * as ngUniversal from 'angular2-universal'; -import { BASE_URL, ORIGIN_URL, REQUEST_URL } from 'angular2-universal/common'; -import { App } from './components/app/app'; - -export default function (params: any): Promise<{ html: string, globals?: any }> { - const serverBindings = [ - ngCore.provide(BASE_URL, { useValue: '/' }), - ngCore.provide(ORIGIN_URL, { useValue: params.origin }), - ngCore.provide(REQUEST_URL, { useValue: params.url }), - ngUniversal.NODE_HTTP_PROVIDERS, - ngUniversal.NODE_ROUTER_PROVIDERS, - FormBuilder - ]; - - return ngUniversal.bootloader({ - directives: [App], - providers: serverBindings, - async: true, - preboot: false, - // TODO: Render just the component instead of wrapping it inside an extra HTML document - // Waiting on https://github.com/angular/universal/issues/347 - template: '\n' - }).serializeApplication().then(html => { - return { html }; - }); -} diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/admin-home/admin-home.html b/samples/angular/MusicStore/wwwroot/ng-app/components/admin/admin-home/admin-home.html deleted file mode 100644 index 79e4fcdd..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/admin-home/admin-home.html +++ /dev/null @@ -1,3 +0,0 @@ -

Store Manager

- - diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/admin-home/admin-home.ts b/samples/angular/MusicStore/wwwroot/ng-app/components/admin/admin-home/admin-home.ts deleted file mode 100644 index 47a501a0..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/admin-home/admin-home.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as ng from 'angular2/core'; -import * as router from 'angular2/router'; -import { AlbumsList } from '../albums-list/albums-list'; -import { AlbumDetails } from '../album-details/album-details'; -import { AlbumEdit } from '../album-edit/album-edit'; - -@ng.Component({ - selector: 'admin-home', - templateUrl: './ng-app/components/admin/admin-home/admin-home.html', - directives: [router.ROUTER_DIRECTIVES] -}) -@router.RouteConfig([ - { path: 'albums', name: 'Albums', component: AlbumsList }, - { path: 'album/details/:albumId', name: 'AlbumDetails', component: AlbumDetails }, - { path: 'album/edit/:albumId', name: 'AlbumEdit', component: AlbumEdit } -]) -export class AdminHome { - -} diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-delete-prompt/album-delete-prompt.html b/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-delete-prompt/album-delete-prompt.html deleted file mode 100644 index 2f6b0ba6..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-delete-prompt/album-delete-prompt.html +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-delete-prompt/album-delete-prompt.ts b/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-delete-prompt/album-delete-prompt.ts deleted file mode 100644 index a3039560..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-delete-prompt/album-delete-prompt.ts +++ /dev/null @@ -1,20 +0,0 @@ -import * as ng from 'angular2/core'; -import * as models from '../../../models/models'; - -@ng.Component({ - selector: 'album-delete-prompt', - templateUrl: './ng-app/components/admin/album-delete-prompt/album-delete-prompt.html' -}) -export class AlbumDeletePrompt { - public album: models.Album; - - constructor(@ng.Inject(ng.ElementRef) private _elementRef: ng.ElementRef) { - } - - public show(album: models.Album) { - this.album = album; - - // Consider rewriting this using Angular 2's "Renderer" API so as to avoid direct DOM access - (window).jQuery(".modal", this._elementRef.nativeElement).modal(); - } -} diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-details/album-details.html b/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-details/album-details.html deleted file mode 100644 index a13e0d1d..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-details/album-details.html +++ /dev/null @@ -1,50 +0,0 @@ -

Album Details

-
- -
- - diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-details/album-details.ts b/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-details/album-details.ts deleted file mode 100644 index 05ac4da6..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-details/album-details.ts +++ /dev/null @@ -1,20 +0,0 @@ -import * as ng from 'angular2/core'; -import * as router from 'angular2/router'; -import * as models from '../../../models/models'; -import { Http, HTTP_BINDINGS } from 'angular2/http'; -import { AlbumDeletePrompt } from '../album-delete-prompt/album-delete-prompt'; - -@ng.Component({ - selector: 'album-details', - templateUrl: './ng-app/components/admin/album-details/album-details.html', - directives: [router.ROUTER_DIRECTIVES, AlbumDeletePrompt] -}) -export class AlbumDetails { - public albumData: models.Album; - - constructor(http: Http, routeParam: router.RouteParams) { - http.get('/api/albums/' + routeParam.params['albumId']).subscribe(result => { - this.albumData = result.json(); - }); - } -} diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-edit/album-edit.html b/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-edit/album-edit.html deleted file mode 100644 index 3b09db19..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-edit/album-edit.html +++ /dev/null @@ -1,47 +0,0 @@ -

Album Edit

-
- -
- - - - - - - - - - - - - -
- $ - -
-
- - - - - - - - - - -
Done! Your changes were saved.
-
{{ errorMessage }}
- - - Back to List -
-
- - diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-edit/album-edit.ts b/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-edit/album-edit.ts deleted file mode 100644 index 4b83c3b4..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/album-edit/album-edit.ts +++ /dev/null @@ -1,94 +0,0 @@ -import * as ng from 'angular2/core'; -import { Observable } from 'rxjs'; -import { Control, ControlGroup, FormBuilder, Validators, FORM_DIRECTIVES } from 'angular2/common'; -import * as router from 'angular2/router'; -import * as models from '../../../models/models'; -import { Http, HTTP_BINDINGS, Headers, Response } from 'angular2/http'; -import { AlbumDeletePrompt } from '../album-delete-prompt/album-delete-prompt'; -import { FormField } from '../form-field/form-field'; -import * as AspNet from 'angular2-aspnet'; - -@ng.Component({ - selector: 'album-edit', - templateUrl: './ng-app/components/admin/album-edit/album-edit.html', - directives: [router.ROUTER_DIRECTIVES, AlbumDeletePrompt, FormField, FORM_DIRECTIVES] -}) -export class AlbumEdit { - public form: ControlGroup; - public artists: models.Artist[]; - public genres: models.Genre[]; - public originalAlbum: models.Album; - public changesSaved: boolean; - public formErrors: string[] = []; - - private _http: Http; - - constructor(fb: FormBuilder, http: Http, routeParam: router.RouteParams) { - this._http = http; - - var albumId = parseInt(routeParam.params['albumId']); - http.get('/api/albums/' + albumId).subscribe(result => { - var json = result.json(); - this.originalAlbum = json; - (this.form.controls['Title']).updateValue(json.Title); - (this.form.controls['Price']).updateValue(json.Price); - (this.form.controls['ArtistId']).updateValue(json.ArtistId); - (this.form.controls['GenreId']).updateValue(json.GenreId); - (this.form.controls['AlbumArtUrl']).updateValue(json.AlbumArtUrl); - }); - - http.get('/api/artists/lookup').subscribe(result => { - this.artists = result.json(); - }); - - http.get('/api/genres/genre-lookup').subscribe(result => { - this.genres = result.json(); - }); - - this.form = fb.group({ - AlbumId: fb.control(albumId), - ArtistId: fb.control(0, Validators.required), - GenreId: fb.control(0, Validators.required), - Title: fb.control('', Validators.required), - Price: fb.control('', Validators.compose([Validators.required, AlbumEdit._validatePrice])), - AlbumArtUrl: fb.control('', Validators.required) - }); - - this.form.valueChanges.subscribe(() => { - this.changesSaved = false; - }); - } - - public onSubmitModelBased() { - // Force all fields to show any validation errors even if they haven't been touched - Object.keys(this.form.controls).forEach(controlName => { - this.form.controls[controlName].markAsTouched(); - }); - - if (this.form.valid) { - var controls = this.form.controls; - var albumId = this.originalAlbum.AlbumId; - - this._putJson(`/api/albums/${ albumId }/update`, this.form.value).subscribe(successResponse => { - this.changesSaved = true; - }, errorResponse => { - AspNet.Validation.showValidationErrors(errorResponse, this.form); - }); - } - } - - private static _validatePrice(control: Control): { [key: string]: boolean } { - return /^\d+\.\d+$/.test(control.value) ? null : { Price: true }; - } - - // Need feedback on whether this really is the easiest way to PUT some JSON - private _putJson(url: string, body: any): Observable { - return this._http.put(url, JSON.stringify(body), { - headers: new Headers({ 'Content-Type': 'application/json' }) - }); - } - - private ngDoCheck() { - this.formErrors = this.form.dirty ? Object.keys(this.form.errors || {}) : []; - } -} diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/albums-list/albums-list.html b/samples/angular/MusicStore/wwwroot/ng-app/components/admin/albums-list/albums-list.html deleted file mode 100644 index 51889e7d..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/albums-list/albums-list.html +++ /dev/null @@ -1,44 +0,0 @@ -

Albums

- - - - - - - - - - - - - - - - - - - - - - -
GenreArtistTitlePrice
{{ row.Genre.Name }}{{ row.Artist.Name }}{{ row.Title }}{{ row.Price | currency:'USD':true }} -
- Details - Edit - Delete -
-
- -
- - - - - -
- -

{{ totalCount }} total albums

diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/albums-list/albums-list.ts b/samples/angular/MusicStore/wwwroot/ng-app/components/admin/albums-list/albums-list.ts deleted file mode 100644 index 989d6e97..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/albums-list/albums-list.ts +++ /dev/null @@ -1,68 +0,0 @@ -import * as ng from 'angular2/core'; -import * as router from 'angular2/router'; -import { Http, HTTP_BINDINGS } from 'angular2/http'; -import * as models from '../../../models/models'; -import { AlbumDeletePrompt } from '../album-delete-prompt/album-delete-prompt'; - -@ng.Component({ - selector: 'albums-list', - templateUrl: './ng-app/components/admin/albums-list/albums-list.html', - directives: [router.ROUTER_DIRECTIVES, AlbumDeletePrompt] -}) -export class AlbumsList { - public rows: models.Album[]; - public canGoBack: boolean; - public canGoForward: boolean; - public pageLinks: any[]; - public totalCount: number; - public get pageIndex() { - return this._pageIndex; - } - - private _http: Http; - private _pageIndex = 1; - private _sortBy = "Title"; - private _sortByDesc = false; - - constructor(http: Http) { - this._http = http; - this.refreshData(); - } - - public sortBy(col: string) { - this._sortByDesc = col === this._sortBy ? !this._sortByDesc : false; - this._sortBy = col; - this.refreshData(); - } - - public goToPage(pageIndex: number) { - this._pageIndex = pageIndex; - this.refreshData(); - } - - public goToLast() { - this.goToPage(this.pageLinks[this.pageLinks.length - 1].index); - } - - refreshData() { - var sortBy = this._sortBy + (this._sortByDesc ? ' DESC' : ''); - this._http.get(`/api/albums?page=${ this._pageIndex }&pageSize=50&sortBy=${ sortBy }`).subscribe(result => { - var json = result.json(); - this.rows = json.Data; - - var numPages = Math.ceil(json.TotalCount / json.PageSize); - this.pageLinks = []; - for (var i = 1; i <= numPages; i++) { - this.pageLinks.push({ - index: i, - text: i.toString(), - isCurrent: i === json.Page - }); - } - - this.canGoBack = this.pageLinks.length && !this.pageLinks[0].isCurrent; - this.canGoForward = this.pageLinks.length && !this.pageLinks[this.pageLinks.length - 1].isCurrent; - this.totalCount = json.TotalCount; - }); - } -} diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/form-field/form-field.html b/samples/angular/MusicStore/wwwroot/ng-app/components/admin/form-field/form-field.html deleted file mode 100644 index 82e773b0..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/form-field/form-field.html +++ /dev/null @@ -1,9 +0,0 @@ -
- -
- - -
-
diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/form-field/form-field.ts b/samples/angular/MusicStore/wwwroot/ng-app/components/admin/form-field/form-field.ts deleted file mode 100644 index 267d7784..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/admin/form-field/form-field.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as ng from 'angular2/core'; -import { AbstractControl } from 'angular2/common'; - -@ng.Component({ - selector: 'form-field', - properties: ['label', 'validate'], - templateUrl: './ng-app/components/admin/form-field/form-field.html' -}) -export class FormField { - public errorMessages: string[] = []; - private validate: AbstractControl; - - private ngDoCheck() { - var errors = (this.validate && this.validate.dirty && this.validate.errors) || {}; - this.errorMessages = Object.keys(errors).map(key => { - return 'Error: ' + key; - }); - } -} diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/app/app.css b/samples/angular/MusicStore/wwwroot/ng-app/components/app/app.css deleted file mode 100644 index e69de29b..00000000 diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/app/app.html b/samples/angular/MusicStore/wwwroot/ng-app/components/app/app.html deleted file mode 100644 index a257b202..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/app/app.html +++ /dev/null @@ -1,30 +0,0 @@ - -
- -
diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/app/app.ts b/samples/angular/MusicStore/wwwroot/ng-app/components/app/app.ts deleted file mode 100644 index cd83aa45..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/app/app.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as ng from 'angular2/core'; -import * as router from 'angular2/router'; -import { Http, HTTP_BINDINGS } from 'angular2/http'; -import { Home } from '../public/home/home'; -import { AlbumDetails } from '../public/album-details/album-details'; -import { GenreContents } from '../public/genre-contents/genre-contents'; -import { GenresList } from '../public/genres-list/genres-list'; -import { AdminHome } from '../admin/admin-home/admin-home'; -import * as models from '../../models/models'; - -@ng.Component({ - selector: 'app', - templateUrl: './ng-app/components/app/app.html', - styleUrls: ['./ng-app/components/app/app.css'], - directives: [router.ROUTER_DIRECTIVES] -}) -@router.RouteConfig([ - { path: '/', component: Home, name: 'Home' }, - { path: '/album/:albumId', component: AlbumDetails, name: 'Album' }, - { path: '/genre/:genreId', component: GenreContents, name: 'Genre' }, - { path: '/genres', component: GenresList, name: 'GenresList' }, - { path: '/admin/...', component: AdminHome, name: 'Admin' } -]) -export class App { - public genres: models.Genre[]; - - constructor(http: Http) { - http.get('/api/genres/menu').subscribe(result => { - this.genres = result.json(); - }); - } -} - diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/public/album-details/album-details.html b/samples/angular/MusicStore/wwwroot/ng-app/components/public/album-details/album-details.html deleted file mode 100644 index d015364e..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/public/album-details/album-details.html +++ /dev/null @@ -1,26 +0,0 @@ -
-

{{ albumData.Title }}

- -

- {{ albumData.Title }} -

- -
-

- Genre: - {{ albumData.Genre.Name }} -

-

- Artist: - {{ albumData.Artist.Name }} -

-

- Price: - {{ albumData.Price | currency:'USD':true }} -

-

- - Add to cart -

-
-
diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/public/album-details/album-details.ts b/samples/angular/MusicStore/wwwroot/ng-app/components/public/album-details/album-details.ts deleted file mode 100644 index 61d7d4ea..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/public/album-details/album-details.ts +++ /dev/null @@ -1,18 +0,0 @@ -import * as ng from 'angular2/core'; -import * as router from 'angular2/router'; -import { Http } from 'angular2/http'; -import * as models from '../../../models/models'; - -@ng.Component({ - selector: 'album-details', - templateUrl: './ng-app/components/public/album-details/album-details.html' -}) -export class AlbumDetails { - public albumData: models.Album; - - constructor(http: Http, routeParam: router.RouteParams) { - http.get('/api/albums/' + routeParam.params['albumId']).subscribe(result => { - this.albumData = result.json(); - }); - } -} diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/public/album-tile/album-tile.html b/samples/angular/MusicStore/wwwroot/ng-app/components/public/album-tile/album-tile.html deleted file mode 100644 index 0df947d1..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/public/album-tile/album-tile.html +++ /dev/null @@ -1,4 +0,0 @@ - - {{ albumData.Title }} -

{{ albumData.Title }}

-
diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/public/album-tile/album-tile.ts b/samples/angular/MusicStore/wwwroot/ng-app/components/public/album-tile/album-tile.ts deleted file mode 100644 index d289ec96..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/public/album-tile/album-tile.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as ng from 'angular2/core'; -import * as router from 'angular2/router'; -import * as models from '../../../models/models'; - -@ng.Component({ - selector: 'album-tile', - properties: ['albumData'], - templateUrl: './ng-app/components/public/album-tile/album-tile.html', - directives: [router.ROUTER_DIRECTIVES] -}) -export class AlbumTile { -} diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/public/genre-contents/genre-contents.html b/samples/angular/MusicStore/wwwroot/ng-app/components/public/genre-contents/genre-contents.html deleted file mode 100644 index 7738ce5e..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/public/genre-contents/genre-contents.html +++ /dev/null @@ -1,7 +0,0 @@ -

Albums

- -
    -
  • - -
  • -
diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/public/genre-contents/genre-contents.ts b/samples/angular/MusicStore/wwwroot/ng-app/components/public/genre-contents/genre-contents.ts deleted file mode 100644 index 0571cc8a..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/public/genre-contents/genre-contents.ts +++ /dev/null @@ -1,20 +0,0 @@ -import * as ng from 'angular2/core'; -import * as router from 'angular2/router'; -import { Http } from 'angular2/http'; -import * as models from '../../../models/models'; -import { AlbumTile } from '../album-tile/album-tile'; - -@ng.Component({ - selector: 'genre-contents', - templateUrl: './ng-app/components/public/genre-contents/genre-contents.html', - directives: [AlbumTile] -}) -export class GenreContents { - public albums: models.Album[]; - - constructor(http: Http, routeParam: router.RouteParams) { - http.get(`/api/genres/${ routeParam.params['genreId'] }/albums`).subscribe(result => { - this.albums = result.json(); - }); - } -} diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/public/genres-list/genres-list.html b/samples/angular/MusicStore/wwwroot/ng-app/components/public/genres-list/genres-list.html deleted file mode 100644 index e91d6f3a..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/public/genres-list/genres-list.html +++ /dev/null @@ -1,13 +0,0 @@ -

Browse Genres

- -

- Select from {{ genres.length }} genres: -

- - diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/public/genres-list/genres-list.ts b/samples/angular/MusicStore/wwwroot/ng-app/components/public/genres-list/genres-list.ts deleted file mode 100644 index f45b77a3..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/public/genres-list/genres-list.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as ng from 'angular2/core'; -import * as router from 'angular2/router'; -import { Http } from 'angular2/http'; -import * as models from '../../../models/models'; - -@ng.Component({ - selector: 'genres-list', - templateUrl: './ng-app/components/public/genres-list/genres-list.html', - directives: [router.ROUTER_DIRECTIVES] -}) -export class GenresList { - public genres: models.Genre[]; - - constructor(http: Http) { - http.get('/api/genres').subscribe(result => { - this.genres = result.json(); - }); - } -} diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/public/home/home.html b/samples/angular/MusicStore/wwwroot/ng-app/components/public/home/home.html deleted file mode 100644 index 133a495c..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/public/home/home.html +++ /dev/null @@ -1,10 +0,0 @@ -
-

MVC Music Store

- -
- -
    -
  • - -
  • -
diff --git a/samples/angular/MusicStore/wwwroot/ng-app/components/public/home/home.ts b/samples/angular/MusicStore/wwwroot/ng-app/components/public/home/home.ts deleted file mode 100644 index 51989da6..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/components/public/home/home.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as ng from 'angular2/core'; -import { Http } from 'angular2/http'; -import { AlbumTile } from '../album-tile/album-tile'; -import * as models from '../../../models/models'; - -@ng.Component({ - selector: 'home', - templateUrl: './ng-app/components/public/home/home.html', - directives: [AlbumTile] -}) -export class Home { - public mostPopular: models.Album[]; - - constructor(http: Http) { - http.get('/api/albums/mostPopular').subscribe(result => { - this.mostPopular = result.json(); - }); - } -} diff --git a/samples/angular/MusicStore/wwwroot/ng-app/models/models.ts b/samples/angular/MusicStore/wwwroot/ng-app/models/models.ts deleted file mode 100644 index 44c705af..00000000 --- a/samples/angular/MusicStore/wwwroot/ng-app/models/models.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface Album { - AlbumId: number; - Title: string; - AlbumArtUrl: string; -} - -export interface Genre { - GenreId: number; - Name: string; - Description: string; -} - -export interface Artist { - ArtistId: number; - Name: string; -} diff --git a/samples/angular/MusicStore/wwwroot/system.config.js b/samples/angular/MusicStore/wwwroot/system.config.js deleted file mode 100644 index 400211f4..00000000 --- a/samples/angular/MusicStore/wwwroot/system.config.js +++ /dev/null @@ -1,3 +0,0 @@ -System.config({ - defaultJSExtensions: true -}); diff --git a/samples/angular/MusicStore/wwwroot/web.config b/samples/angular/MusicStore/wwwroot/web.config deleted file mode 100644 index bb50c716..00000000 --- a/samples/angular/MusicStore/wwwroot/web.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/samples/misc/LatencyTest/LatencyTest.csproj b/samples/misc/LatencyTest/LatencyTest.csproj new file mode 100644 index 00000000..c146eb6a --- /dev/null +++ b/samples/misc/LatencyTest/LatencyTest.csproj @@ -0,0 +1,19 @@ + + + + netcoreapp3.0 + false + exe + + + + + + + + + + + + + diff --git a/samples/misc/LatencyTest/LatencyTest.xproj b/samples/misc/LatencyTest/LatencyTest.xproj deleted file mode 100644 index 310b3bac..00000000 --- a/samples/misc/LatencyTest/LatencyTest.xproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - 14.0.25123 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - a64af9d9-72aa-4433-be1d-dc2524b6808a - LatencyTest - .\obj - .\bin\ - - - - 2.0 - - - \ No newline at end of file diff --git a/samples/misc/LatencyTest/Program.cs b/samples/misc/LatencyTest/Program.cs index 2087d29e..bafe4b9f 100755 --- a/samples/misc/LatencyTest/Program.cs +++ b/samples/misc/LatencyTest/Program.cs @@ -3,6 +3,8 @@ using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.NodeServices; +using Microsoft.AspNetCore.NodeServices.Sockets; +using Microsoft.Extensions.DependencyInjection; namespace ConsoleApplication { @@ -12,7 +14,19 @@ namespace ConsoleApplication public class Program { public static void Main(string[] args) { - using (var nodeServices = CreateNodeServices(NodeServicesOptions.DefaultNodeHostingModel)) { + // Set up the DI system + var services = new ServiceCollection(); + services.AddNodeServices(options => { + // To compare with Socket hosting, uncomment the following line + // Since .NET Core 1.1, the HTTP hosting model has become basically as fast as the Socket hosting model + //options.UseSocketHosting(); + + options.WatchFileExtensions = new string[] {}; // Don't watch anything + }); + var serviceProvider = services.BuildServiceProvider(); + + // Now instantiate an INodeServices and use it + using (var nodeServices = serviceProvider.GetRequiredService()) { MeasureLatency(nodeServices).Wait(); } } @@ -34,13 +48,5 @@ private static async Task MeasureLatency(INodeServices nodeServices) { Console.WriteLine("\nTotal time: {0:F2} milliseconds", 1000 * elapsedSeconds); Console.WriteLine("\nTime per invocation: {0:F2} milliseconds", 1000 * elapsedSeconds / requestCount); } - - private static INodeServices CreateNodeServices(NodeHostingModel hostingModel) { - return Configuration.CreateNodeServices(new NodeServicesOptions { - HostingModel = hostingModel, - ProjectPath = Directory.GetCurrentDirectory(), - WatchFileExtensions = new string[] {} // Don't watch anything - }); - } } } diff --git a/samples/misc/LatencyTest/project.json b/samples/misc/LatencyTest/project.json deleted file mode 100755 index 33820b5d..00000000 --- a/samples/misc/LatencyTest/project.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true - }, - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.0", - "type": "platform" - }, - "Microsoft.AspNetCore.NodeServices": "1.0.0-*" - }, - "frameworks": { - "netcoreapp1.0": { - "imports": "dnxcore50" - } - } -} diff --git a/samples/misc/NodeServicesExamples/Controllers/HomeController.cs b/samples/misc/NodeServicesExamples/Controllers/HomeController.cs index 34ce07c6..d9f32410 100755 --- a/samples/misc/NodeServicesExamples/Controllers/HomeController.cs +++ b/samples/misc/NodeServicesExamples/Controllers/HomeController.cs @@ -1,5 +1,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.NodeServices; +using Microsoft.AspNetCore.SpaServices.Prerendering; namespace NodeServicesExamples.Controllers { @@ -15,8 +17,35 @@ public IActionResult ES2015Transpilation() return View(); } - public IActionResult ImageResizing() + public async Task Chart([FromServices] INodeServices nodeServices) { + var options = new { width = 400, height = 200, showArea = true, showPoint = true, fullWidth = true }; + var data = new + { + labels = new[] { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }, + series = new[] { + new[] { 1, 5, 2, 5, 4, 3 }, + new[] { 2, 3, 4, 8, 1, 2 }, + new[] { 5, 4, 3, 2, 1, 0 } + } + }; + + ViewData["ChartMarkup"] = await nodeServices.InvokeAsync("./Node/renderChart", "line", options, data); + + return View(); + } + + public async Task Prerendering([FromServices] ISpaPrerenderer prerenderer) + { + var result = await prerenderer.RenderToString("./Node/prerenderPage"); + + if (!string.IsNullOrEmpty(result.RedirectUrl)) + { + return Redirect(result.RedirectUrl); + } + + ViewData["PrerenderedHtml"] = result.Html; + ViewData["PrerenderedGlobals"] = result.CreateGlobalsAssignmentScript(); return View(); } diff --git a/samples/misc/NodeServicesExamples/Controllers/ResizeImage.cs b/samples/misc/NodeServicesExamples/Controllers/ResizeImage.cs deleted file mode 100644 index 43f45df3..00000000 --- a/samples/misc/NodeServicesExamples/Controllers/ResizeImage.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.IO; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.NodeServices; -using Microsoft.AspNetCore.StaticFiles; - -namespace NodeServicesExamples.Controllers -{ - public class ResizeImageController : Controller - { - private const int MaxDimension = 1000; - private static string[] AllowedMimeTypes = new[] { "image/jpeg", "image/png", "image/gif" }; - - private IHostingEnvironment _environment; - private INodeServices _nodeServices; - - public ResizeImageController(IHostingEnvironment environment, INodeServices nodeServices) - { - _environment = environment; - _nodeServices = nodeServices; - } - - [Route("resize/{*imagePath}")] - public async Task Index(string imagePath, int maxWidth, int maxHeight) - { - // Validate incoming params - if (maxWidth < 0 || maxHeight < 0 || maxWidth > MaxDimension || maxHeight > MaxDimension - || (maxWidth + maxHeight) == 0) - { - return BadRequest("Invalid dimensions"); - } - - var mimeType = GetContentType(imagePath); - if (Array.IndexOf(AllowedMimeTypes, mimeType) < 0) - { - return BadRequest("Disallowed image format"); - } - - // Locate source image on disk - var fileInfo = _environment.WebRootFileProvider.GetFileInfo(imagePath); - if (!fileInfo.Exists) - { - return NotFound(); - } - - // Invoke Node and pipe the result to the response - var imageStream = await _nodeServices.InvokeAsync( - "./Node/resizeImage", - fileInfo.PhysicalPath, - mimeType, - maxWidth, - maxHeight); - return File(imageStream, mimeType); - } - - private string GetContentType(string path) - { - string result; - return new FileExtensionContentTypeProvider().TryGetContentType(path, out result) ? result : null; - } - } -} diff --git a/samples/misc/NodeServicesExamples/Node/prerenderPage.js b/samples/misc/NodeServicesExamples/Node/prerenderPage.js new file mode 100644 index 00000000..7912a6f3 --- /dev/null +++ b/samples/misc/NodeServicesExamples/Node/prerenderPage.js @@ -0,0 +1,14 @@ +var createServerRenderer = require('aspnet-prerendering').createServerRenderer; + +module.exports = createServerRenderer(function(params) { + return new Promise(function (resolve, reject) { + var message = 'The HTML was returned by the prerendering boot function. ' + + 'The boot function received the following params:' + + '
' + JSON.stringify(params, null, 4) + '
'; + + resolve({ + html: '

Hello, world!

' + message, + globals: { sampleData: { nodeVersion: process.version } } + }); + }); +}); diff --git a/samples/misc/NodeServicesExamples/Node/renderChart.js b/samples/misc/NodeServicesExamples/Node/renderChart.js new file mode 100644 index 00000000..370df766 --- /dev/null +++ b/samples/misc/NodeServicesExamples/Node/renderChart.js @@ -0,0 +1,8 @@ +var generate = require('node-chartist'); + +module.exports = function (callback, type, options, data) { + generate(type, options, data).then( + result => callback(null, result), // Success case + error => callback(error) // Error case + ); +}; diff --git a/samples/misc/NodeServicesExamples/Node/resizeImage.js b/samples/misc/NodeServicesExamples/Node/resizeImage.js deleted file mode 100644 index 207b149f..00000000 --- a/samples/misc/NodeServicesExamples/Node/resizeImage.js +++ /dev/null @@ -1,8 +0,0 @@ -var sharp = require('sharp'); - -module.exports = function(result, physicalPath, mimeType, maxWidth, maxHeight) { - // Invoke the 'sharp' NPM module, and have it pipe the resulting image data back to .NET - sharp(physicalPath) - .resize(maxWidth || null, maxHeight || null) - .pipe(result.stream); -} diff --git a/samples/misc/NodeServicesExamples/NodeServicesExamples.csproj b/samples/misc/NodeServicesExamples/NodeServicesExamples.csproj new file mode 100644 index 00000000..874807b9 --- /dev/null +++ b/samples/misc/NodeServicesExamples/NodeServicesExamples.csproj @@ -0,0 +1,29 @@ + + + + netcoreapp3.0 + true + false + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/misc/NodeServicesExamples/NodeServicesExamples.xproj b/samples/misc/NodeServicesExamples/NodeServicesExamples.xproj deleted file mode 100644 index 2cd1742b..00000000 --- a/samples/misc/NodeServicesExamples/NodeServicesExamples.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - true - - - - 6d4bcdd6-7951-449b-be55-cb7f014b7430 - NodeServicesExamples - ..\..\..\JavaScriptServices.sln\artifacts\obj\$(MSBuildProjectName) - .\bin\ - - - 2.0 - 2018 - - - \ No newline at end of file diff --git a/samples/misc/NodeServicesExamples/Startup.cs b/samples/misc/NodeServicesExamples/Startup.cs index 1c38c60a..26f2ae86 100755 --- a/samples/misc/NodeServicesExamples/Startup.cs +++ b/samples/misc/NodeServicesExamples/Startup.cs @@ -17,6 +17,7 @@ public void ConfigureServices(IServiceCollection services) // Enable Node Services services.AddNodeServices(); + services.AddSpaPrerenderer(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -41,7 +42,6 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHo }); app.UseStaticFiles(); - loggerFactory.AddConsole(); app.UseMvc(routes => { routes.MapRoute( @@ -53,6 +53,11 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHo public static void Main(string[] args) { var host = new WebHostBuilder() + .ConfigureLogging(factory => + { + factory.AddConsole(); + factory.AddDebug(); + }) .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseKestrel() diff --git a/samples/misc/NodeServicesExamples/Views/Home/Chart.cshtml b/samples/misc/NodeServicesExamples/Views/Home/Chart.cshtml new file mode 100644 index 00000000..2775261e --- /dev/null +++ b/samples/misc/NodeServicesExamples/Views/Home/Chart.cshtml @@ -0,0 +1,12 @@ +

Server-rendered chart

+ +

+ This sample demonstrates how arbitrary NPM modules can be invoked from .NET code. +

+

+ In this case, we use node-chartist to render the following chart on the server. The output is + identical to what you'd get if you used chartist.js + on the client, except that in this example, we're not executing any client-side code at all. +

+ +@Html.Raw(ViewData["ChartMarkup"]) diff --git a/samples/misc/NodeServicesExamples/Views/Home/ImageResizing.cshtml b/samples/misc/NodeServicesExamples/Views/Home/ImageResizing.cshtml deleted file mode 100644 index ff1ae6b6..00000000 --- a/samples/misc/NodeServicesExamples/Views/Home/ImageResizing.cshtml +++ /dev/null @@ -1,34 +0,0 @@ -

Image Resizing

- -

- This sample shows how the NPM module sharp - can be used for dynamic image resizing from within an ASP.NET Core application. There is one copy of the - following image on disk, but we can set up an MVC action method that returns it resized to fit within an - arbitrary width and height. -

- -

- Dependencies: On Windows and Linux, there are no native dependencies. Just running - npm install is enough. On OS X, however, you need to have libvips installed, - which you can get through Homebrew by running - brew install homebrew/science/vips. -

- -

100px wide [open]

- - -

200px wide [open]

- - -

400px wide [open]

- - -

800px wide [open]

- - -

- Credit: - Parrot - by D Coetzee - is dedicated to the public domain (CC0) -

diff --git a/samples/misc/NodeServicesExamples/Views/Home/Index.cshtml b/samples/misc/NodeServicesExamples/Views/Home/Index.cshtml index 50d388c5..bbdc5631 100644 --- a/samples/misc/NodeServicesExamples/Views/Home/Index.cshtml +++ b/samples/misc/NodeServicesExamples/Views/Home/Index.cshtml @@ -7,7 +7,7 @@

diff --git a/samples/misc/NodeServicesExamples/Views/Home/Prerendering.cshtml b/samples/misc/NodeServicesExamples/Views/Home/Prerendering.cshtml new file mode 100644 index 00000000..bd5fff9d --- /dev/null +++ b/samples/misc/NodeServicesExamples/Views/Home/Prerendering.cshtml @@ -0,0 +1,21 @@ +

Server-side prerendering

+ +

+ This sample demonstrates how you can invoke a JavaScript module that contains + prerendering logic for a Single-Page Application framework. +

+

+ Your prerendering boot function will receive parameters that describe the page + being rendered and any data supplied by the .NET code. The return value should be + a promise that resolves with data to be injected into the page, such as the + rendered HTML and any global data that should be made available to client-side code. +

+ +@Html.Raw(ViewData["PrerenderedHtml"]) + + + + diff --git a/samples/misc/NodeServicesExamples/Views/Shared/_Layout.cshtml b/samples/misc/NodeServicesExamples/Views/Shared/_Layout.cshtml index 23ebe30d..93314312 100755 --- a/samples/misc/NodeServicesExamples/Views/Shared/_Layout.cshtml +++ b/samples/misc/NodeServicesExamples/Views/Shared/_Layout.cshtml @@ -1,8 +1,9 @@ - + NodeServices Examples + @RenderBody() diff --git a/samples/misc/NodeServicesExamples/package.json b/samples/misc/NodeServicesExamples/package.json index 6f6640d2..9787758b 100644 --- a/samples/misc/NodeServicesExamples/package.json +++ b/samples/misc/NodeServicesExamples/package.json @@ -2,8 +2,9 @@ "name": "nodeservicesexamples", "version": "0.0.0", "dependencies": { + "aspnet-prerendering": "^2.0.6", "babel-core": "^6.7.4", "babel-preset-es2015": "^6.6.0", - "sharp": "^0.15.0" + "node-chartist": "^1.0.2" } } diff --git a/samples/misc/NodeServicesExamples/project.json b/samples/misc/NodeServicesExamples/project.json deleted file mode 100755 index eb168a66..00000000 --- a/samples/misc/NodeServicesExamples/project.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "version": "1.0.0-*", - "tooling": { - "defaultNamespace": "NodeServicesExamples" - }, - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "runtimeOptions": { - "gcServer": true - }, - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.0", - "type": "platform" - }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", - "Microsoft.AspNetCore.Mvc": "1.0.0", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", - "Microsoft.AspNetCore.StaticFiles": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Logging.Console": "1.0.0", - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.Extensions.Logging.Debug": "1.0.0", - "Microsoft.AspNetCore.NodeServices": "1.0.0-*" - }, - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "dotnet5.6", - "dnxcore50", - "portable-net45+win8" - ] - } - }, - "publishExclude": [ - "node_modules", - "bower_components", - "**.xproj", - "**.user", - "**.vspscc" - ], - "scripts": { - "prepublish": [ "npm install" ], - "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] - } -} diff --git a/samples/misc/NodeServicesExamples/wwwroot/css/chartist.min.css b/samples/misc/NodeServicesExamples/wwwroot/css/chartist.min.css new file mode 100644 index 00000000..9f9b908e --- /dev/null +++ b/samples/misc/NodeServicesExamples/wwwroot/css/chartist.min.css @@ -0,0 +1 @@ +.ct-double-octave:after,.ct-major-eleventh:after,.ct-major-second:after,.ct-major-seventh:after,.ct-major-sixth:after,.ct-major-tenth:after,.ct-major-third:after,.ct-major-twelfth:after,.ct-minor-second:after,.ct-minor-seventh:after,.ct-minor-sixth:after,.ct-minor-third:after,.ct-octave:after,.ct-perfect-fifth:after,.ct-perfect-fourth:after,.ct-square:after{content:"";clear:both}.ct-label{fill:rgba(0,0,0,.4);color:rgba(0,0,0,.4);font-size:.75rem;line-height:1}.ct-grid-background,.ct-line{fill:none}.ct-chart-bar .ct-label,.ct-chart-line .ct-label{display:block;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.ct-chart-donut .ct-label,.ct-chart-pie .ct-label{dominant-baseline:central}.ct-label.ct-horizontal.ct-start{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-horizontal.ct-end{-webkit-box-align:flex-start;-webkit-align-items:flex-start;-ms-flex-align:flex-start;align-items:flex-start;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-label.ct-vertical.ct-start{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:flex-end;-webkit-justify-content:flex-end;-ms-flex-pack:flex-end;justify-content:flex-end;text-align:right;text-anchor:end}.ct-label.ct-vertical.ct-end{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar .ct-label.ct-horizontal.ct-start{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar .ct-label.ct-horizontal.ct-end{-webkit-box-align:flex-start;-webkit-align-items:flex-start;-ms-flex-align:flex-start;align-items:flex-start;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start{-webkit-box-align:flex-end;-webkit-align-items:flex-end;-ms-flex-align:flex-end;align-items:flex-end;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end{-webkit-box-align:flex-start;-webkit-align-items:flex-start;-ms-flex-align:flex-start;align-items:flex-start;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:start}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:flex-end;-webkit-justify-content:flex-end;-ms-flex-pack:flex-end;justify-content:flex-end;text-align:right;text-anchor:end}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:flex-start;-webkit-justify-content:flex-start;-ms-flex-pack:flex-start;justify-content:flex-start;text-align:left;text-anchor:end}.ct-grid{stroke:rgba(0,0,0,.2);stroke-width:1px;stroke-dasharray:2px}.ct-point{stroke-width:10px;stroke-linecap:round}.ct-line{stroke-width:4px}.ct-area{stroke:none;fill-opacity:.1}.ct-bar{fill:none;stroke-width:10px}.ct-slice-donut{fill:none;stroke-width:60px}.ct-series-a .ct-bar,.ct-series-a .ct-line,.ct-series-a .ct-point,.ct-series-a .ct-slice-donut{stroke:#d70206}.ct-series-a .ct-area,.ct-series-a .ct-slice-pie{fill:#d70206}.ct-series-b .ct-bar,.ct-series-b .ct-line,.ct-series-b .ct-point,.ct-series-b .ct-slice-donut{stroke:#f05b4f}.ct-series-b .ct-area,.ct-series-b .ct-slice-pie{fill:#f05b4f}.ct-series-c .ct-bar,.ct-series-c .ct-line,.ct-series-c .ct-point,.ct-series-c .ct-slice-donut{stroke:#f4c63d}.ct-series-c .ct-area,.ct-series-c .ct-slice-pie{fill:#f4c63d}.ct-series-d .ct-bar,.ct-series-d .ct-line,.ct-series-d .ct-point,.ct-series-d .ct-slice-donut{stroke:#d17905}.ct-series-d .ct-area,.ct-series-d .ct-slice-pie{fill:#d17905}.ct-series-e .ct-bar,.ct-series-e .ct-line,.ct-series-e .ct-point,.ct-series-e .ct-slice-donut{stroke:#453d3f}.ct-series-e .ct-area,.ct-series-e .ct-slice-pie{fill:#453d3f}.ct-series-f .ct-bar,.ct-series-f .ct-line,.ct-series-f .ct-point,.ct-series-f .ct-slice-donut{stroke:#59922b}.ct-series-f .ct-area,.ct-series-f .ct-slice-pie{fill:#59922b}.ct-series-g .ct-bar,.ct-series-g .ct-line,.ct-series-g .ct-point,.ct-series-g .ct-slice-donut{stroke:#0544d3}.ct-series-g .ct-area,.ct-series-g .ct-slice-pie{fill:#0544d3}.ct-series-h .ct-bar,.ct-series-h .ct-line,.ct-series-h .ct-point,.ct-series-h .ct-slice-donut{stroke:#6b0392}.ct-series-h .ct-area,.ct-series-h .ct-slice-pie{fill:#6b0392}.ct-series-i .ct-bar,.ct-series-i .ct-line,.ct-series-i .ct-point,.ct-series-i .ct-slice-donut{stroke:#f05b4f}.ct-series-i .ct-area,.ct-series-i .ct-slice-pie{fill:#f05b4f}.ct-series-j .ct-bar,.ct-series-j .ct-line,.ct-series-j .ct-point,.ct-series-j .ct-slice-donut{stroke:#dda458}.ct-series-j .ct-area,.ct-series-j .ct-slice-pie{fill:#dda458}.ct-series-k .ct-bar,.ct-series-k .ct-line,.ct-series-k .ct-point,.ct-series-k .ct-slice-donut{stroke:#eacf7d}.ct-series-k .ct-area,.ct-series-k .ct-slice-pie{fill:#eacf7d}.ct-series-l .ct-bar,.ct-series-l .ct-line,.ct-series-l .ct-point,.ct-series-l .ct-slice-donut{stroke:#86797d}.ct-series-l .ct-area,.ct-series-l .ct-slice-pie{fill:#86797d}.ct-series-m .ct-bar,.ct-series-m .ct-line,.ct-series-m .ct-point,.ct-series-m .ct-slice-donut{stroke:#b2c326}.ct-series-m .ct-area,.ct-series-m .ct-slice-pie{fill:#b2c326}.ct-series-n .ct-bar,.ct-series-n .ct-line,.ct-series-n .ct-point,.ct-series-n .ct-slice-donut{stroke:#6188e2}.ct-series-n .ct-area,.ct-series-n .ct-slice-pie{fill:#6188e2}.ct-series-o .ct-bar,.ct-series-o .ct-line,.ct-series-o .ct-point,.ct-series-o .ct-slice-donut{stroke:#a748ca}.ct-series-o .ct-area,.ct-series-o .ct-slice-pie{fill:#a748ca}.ct-square{display:block;position:relative;width:100%}.ct-square:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:100%}.ct-square:after{display:table}.ct-square>svg{display:block;position:absolute;top:0;left:0}.ct-minor-second{display:block;position:relative;width:100%}.ct-minor-second:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:93.75%}.ct-minor-second:after{display:table}.ct-minor-second>svg{display:block;position:absolute;top:0;left:0}.ct-major-second{display:block;position:relative;width:100%}.ct-major-second:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:88.8888888889%}.ct-major-second:after{display:table}.ct-major-second>svg{display:block;position:absolute;top:0;left:0}.ct-minor-third{display:block;position:relative;width:100%}.ct-minor-third:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:83.3333333333%}.ct-minor-third:after{display:table}.ct-minor-third>svg{display:block;position:absolute;top:0;left:0}.ct-major-third{display:block;position:relative;width:100%}.ct-major-third:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:80%}.ct-major-third:after{display:table}.ct-major-third>svg{display:block;position:absolute;top:0;left:0}.ct-perfect-fourth{display:block;position:relative;width:100%}.ct-perfect-fourth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:75%}.ct-perfect-fourth:after{display:table}.ct-perfect-fourth>svg{display:block;position:absolute;top:0;left:0}.ct-perfect-fifth{display:block;position:relative;width:100%}.ct-perfect-fifth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:66.6666666667%}.ct-perfect-fifth:after{display:table}.ct-perfect-fifth>svg{display:block;position:absolute;top:0;left:0}.ct-minor-sixth{display:block;position:relative;width:100%}.ct-minor-sixth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:62.5%}.ct-minor-sixth:after{display:table}.ct-minor-sixth>svg{display:block;position:absolute;top:0;left:0}.ct-golden-section{display:block;position:relative;width:100%}.ct-golden-section:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:61.804697157%}.ct-golden-section:after{content:"";display:table;clear:both}.ct-golden-section>svg{display:block;position:absolute;top:0;left:0}.ct-major-sixth{display:block;position:relative;width:100%}.ct-major-sixth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:60%}.ct-major-sixth:after{display:table}.ct-major-sixth>svg{display:block;position:absolute;top:0;left:0}.ct-minor-seventh{display:block;position:relative;width:100%}.ct-minor-seventh:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:56.25%}.ct-minor-seventh:after{display:table}.ct-minor-seventh>svg{display:block;position:absolute;top:0;left:0}.ct-major-seventh{display:block;position:relative;width:100%}.ct-major-seventh:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:53.3333333333%}.ct-major-seventh:after{display:table}.ct-major-seventh>svg{display:block;position:absolute;top:0;left:0}.ct-octave{display:block;position:relative;width:100%}.ct-octave:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:50%}.ct-octave:after{display:table}.ct-octave>svg{display:block;position:absolute;top:0;left:0}.ct-major-tenth{display:block;position:relative;width:100%}.ct-major-tenth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:40%}.ct-major-tenth:after{display:table}.ct-major-tenth>svg{display:block;position:absolute;top:0;left:0}.ct-major-eleventh{display:block;position:relative;width:100%}.ct-major-eleventh:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:37.5%}.ct-major-eleventh:after{display:table}.ct-major-eleventh>svg{display:block;position:absolute;top:0;left:0}.ct-major-twelfth{display:block;position:relative;width:100%}.ct-major-twelfth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:33.3333333333%}.ct-major-twelfth:after{display:table}.ct-major-twelfth>svg{display:block;position:absolute;top:0;left:0}.ct-double-octave{display:block;position:relative;width:100%}.ct-double-octave:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:25%}.ct-double-octave:after{display:table}.ct-double-octave>svg{display:block;position:absolute;top:0;left:0} \ No newline at end of file diff --git a/samples/misc/NodeServicesExamples/wwwroot/images/parrot.jpg b/samples/misc/NodeServicesExamples/wwwroot/images/parrot.jpg deleted file mode 100644 index 828a55b2..00000000 Binary files a/samples/misc/NodeServicesExamples/wwwroot/images/parrot.jpg and /dev/null differ diff --git a/samples/misc/Webpack/.gitignore b/samples/misc/Webpack/.gitignore index 0ca27f04..13634919 100644 --- a/samples/misc/Webpack/.gitignore +++ b/samples/misc/Webpack/.gitignore @@ -1,6 +1,9 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. +yarn.lock +wwwroot/dist + # User-specific files *.suo *.user @@ -40,10 +43,6 @@ TestResult.xml [Rr]eleasePS/ dlldata.c -# DNX -project.lock.json -artifacts/ - *_i.c *_p.c *_i.h diff --git a/samples/misc/Webpack/ActionResults/PrerenderResult.cs b/samples/misc/Webpack/ActionResults/PrerenderResult.cs new file mode 100644 index 00000000..4f2c8f50 --- /dev/null +++ b/samples/misc/Webpack/ActionResults/PrerenderResult.cs @@ -0,0 +1,51 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Extensions; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.NodeServices; +using Microsoft.AspNetCore.SpaServices.Prerendering; +using Microsoft.Extensions.DependencyInjection; + +namespace Webpack.ActionResults +{ + // This is an example of how you could invoke the prerendering API from an ActionResult, so as to + // prerender a SPA component as the entire response page (instead of injecting the SPA component + // into a Razor view's output) + public class PrerenderResult : ActionResult + { + private JavaScriptModuleExport _moduleExport; + private object _dataToSupply; + + public PrerenderResult(JavaScriptModuleExport moduleExport, object dataToSupply = null) + { + _moduleExport = moduleExport; + _dataToSupply = dataToSupply; + } + + public override async Task ExecuteResultAsync(ActionContext context) + { + var nodeServices = context.HttpContext.RequestServices.GetRequiredService(); + var hostEnv = context.HttpContext.RequestServices.GetRequiredService(); + var applicationLifetime = context.HttpContext.RequestServices.GetRequiredService(); + var applicationBasePath = hostEnv.ContentRootPath; + var request = context.HttpContext.Request; + var response = context.HttpContext.Response; + + var prerenderedHtml = await Prerenderer.RenderToString( + applicationBasePath, + nodeServices, + applicationLifetime.ApplicationStopping, + _moduleExport, + request.GetEncodedUrl(), + request.Path + request.QueryString.Value, + _dataToSupply, + /* timeoutMilliseconds */ 30000, + /* requestPathBase */ "/" + ); + + response.ContentType = "text/html"; + await response.WriteAsync(prerenderedHtml.Html); + } + } +} \ No newline at end of file diff --git a/samples/misc/Webpack/ActionResults/PrerenderResultExtensions.cs b/samples/misc/Webpack/ActionResults/PrerenderResultExtensions.cs new file mode 100644 index 00000000..926e1149 --- /dev/null +++ b/samples/misc/Webpack/ActionResults/PrerenderResultExtensions.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.SpaServices.Prerendering; + +namespace Webpack.ActionResults +{ + public static class PrerenderResultExtensions + { + public static PrerenderResult Prerender(this ControllerBase controller, JavaScriptModuleExport exportToPrerender, object dataToSupply = null) + { + return new PrerenderResult(exportToPrerender, dataToSupply); + } + } +} diff --git a/samples/misc/Webpack/Dockerfile b/samples/misc/Webpack/Dockerfile deleted file mode 100644 index 63d7c456..00000000 --- a/samples/misc/Webpack/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM microsoft/aspnet:1.0.0-rc1-update1 - -RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list -RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/* - -COPY . /app -WORKDIR /app -RUN ["dnu", "restore"] - -EXPOSE 5000/tcp -ENTRYPOINT ["dnx", "-p", "project.json", "web"] diff --git a/samples/misc/Webpack/Startup.cs b/samples/misc/Webpack/Startup.cs index a19fcc1a..a471781e 100755 --- a/samples/misc/Webpack/Startup.cs +++ b/samples/misc/Webpack/Startup.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using System.IO; +using Microsoft.AspNetCore.NodeServices; namespace Webpack { @@ -14,6 +15,7 @@ public class Startup public void ConfigureServices(IServiceCollection services) { services.AddMvc(); + services.AddNodeServices(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -30,7 +32,6 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHo }); app.UseStaticFiles(); - loggerFactory.AddConsole(); app.UseMvc(routes => { routes.MapRoute( @@ -42,6 +43,11 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHo public static void Main(string[] args) { var host = new WebHostBuilder() + .ConfigureLogging(factory => + { + factory.AddConsole(); + factory.AddDebug(); + }) .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseKestrel() diff --git a/samples/misc/Webpack/Webpack.csproj b/samples/misc/Webpack/Webpack.csproj new file mode 100644 index 00000000..874807b9 --- /dev/null +++ b/samples/misc/Webpack/Webpack.csproj @@ -0,0 +1,29 @@ + + + + netcoreapp3.0 + true + false + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/misc/Webpack/Webpack.xproj b/samples/misc/Webpack/Webpack.xproj deleted file mode 100644 index 5f9cc8f9..00000000 --- a/samples/misc/Webpack/Webpack.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - true - - - - a8905301-8492-42fd-9e83-f715a0fdc3a2 - Webpack - ..\..\..\JavaScriptServices.sln\artifacts\obj\$(MSBuildProjectName) - ..\..\..\JavaScriptServices.sln\artifacts\bin\$(MSBuildProjectName)\ - - - 2.0 - 2018 - - - diff --git a/samples/misc/Webpack/package.json b/samples/misc/Webpack/package.json index 39bacb81..3216132b 100644 --- a/samples/misc/Webpack/package.json +++ b/samples/misc/Webpack/package.json @@ -2,15 +2,19 @@ "name": "Webpack", "version": "0.0.0", "devDependencies": { - "aspnet-webpack": "^1.0.3", "css-loader": "^0.23.1", "extendify": "^1.0.0", "extract-text-webpack-plugin": "^1.0.1", "less": "^2.6.0", "less-loader": "^2.2.2", "style-loader": "^0.13.0", - "ts-loader": "^0.8.1", - "typescript": "^1.7.5", "webpack-hot-middleware": "^2.7.1" + }, + "dependencies": { + "aspnet-prerendering": "^1.0.4", + "aspnet-webpack": "^1.0.3", + "ts-loader": "^0.8.1", + "typescript": "^2.0.0", + "webpack": "^1.13.3" } } diff --git a/samples/misc/Webpack/project.json b/samples/misc/Webpack/project.json deleted file mode 100755 index 1b02246b..00000000 --- a/samples/misc/Webpack/project.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "runtimeOptions": { - "gcServer": true - }, - "tooling": { - "defaultNamespace": "Webpack" - }, - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.0", - "type": "platform" - }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", - "Microsoft.AspNetCore.Mvc": "1.0.0", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", - "Microsoft.AspNetCore.StaticFiles": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Logging.Console": "1.0.0", - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.Extensions.Logging.Debug": "1.0.0", - "Microsoft.AspNetCore.SpaServices": "1.0.0-*" - }, - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "dotnet5.6", - "dnxcore50", - "portable-net45+win8" - ] - } - }, - "publishOptions": { - "exclude": [ - "node_modules", - "bower_components", - "**.xproj", - "**.user", - "**.vspscc" - ] - }, - "scripts": { - "prepublish": [ "npm install" ], - "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] - } -} diff --git a/samples/misc/Webpack/tsconfig.json b/samples/misc/Webpack/tsconfig.json index 5cbeb866..453b7a33 100644 --- a/samples/misc/Webpack/tsconfig.json +++ b/samples/misc/Webpack/tsconfig.json @@ -1,9 +1,11 @@ { "compilerOptions": { "moduleResolution": "node", + "module": "commonjs", "target": "es5", "jsx": "preserve", - "sourceMap": true + "sourceMap": true, + "lib": ["es6", "dom"] }, "exclude": [ "node_modules" diff --git a/samples/misc/Webpack/webpack.config.dev.js b/samples/misc/Webpack/webpack.config.dev.js index 08e05f4b..fc339d2e 100644 --- a/samples/misc/Webpack/webpack.config.dev.js +++ b/samples/misc/Webpack/webpack.config.dev.js @@ -2,7 +2,7 @@ module.exports = { devtool: 'inline-source-map', module: { loaders: [ - { test: /\.less$/, loader: 'style!css!less' } + { test: /\.less$/, loader: 'style-loader!css-loader!less-loader' } ] } }; diff --git a/samples/misc/Webpack/webpack.config.js b/samples/misc/Webpack/webpack.config.js index 5ff186da..011ed5f2 100644 --- a/samples/misc/Webpack/webpack.config.js +++ b/samples/misc/Webpack/webpack.config.js @@ -10,7 +10,7 @@ module.exports = merge({ }, module: { loaders: [ - { test: /\.ts(x?)$/, exclude: /node_modules/, loader: 'ts-loader' } + { test: /\.ts(x?)$/, exclude: /node_modules/, loader: 'ts-loader?silent' } ], }, entry: { diff --git a/samples/misc/Webpack/webpack.config.prod.js b/samples/misc/Webpack/webpack.config.prod.js index 5dbe0c8f..56203448 100644 --- a/samples/misc/Webpack/webpack.config.prod.js +++ b/samples/misc/Webpack/webpack.config.prod.js @@ -5,11 +5,11 @@ var extractLESS = new ExtractTextPlugin('my-styles.css'); module.exports = { module: { loaders: [ - { test: /\.less$/, loader: extractLESS.extract(['css', 'less']) }, + { test: /\.less$/, loader: extractLESS.extract(['css-loader', 'less-loader']) }, ] }, plugins: [ extractLESS, - new webpack.optimize.UglifyJsPlugin({ minimize: true }) + new webpack.optimize.UglifyJsPlugin({ minimize: true, compressor: { warnings: false } }) ] }; diff --git a/samples/react/MusicStore/.babelrc b/samples/react/MusicStore/.babelrc deleted file mode 100644 index 86c445f5..00000000 --- a/samples/react/MusicStore/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["es2015", "react"] -} diff --git a/samples/react/MusicStore/.gitignore b/samples/react/MusicStore/.gitignore deleted file mode 100644 index bca785d4..00000000 --- a/samples/react/MusicStore/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -music-db.sqlite -/wwwroot/dist/ -/node_modules/ diff --git a/samples/react/MusicStore/Apis/AlbumsApiController.cs b/samples/react/MusicStore/Apis/AlbumsApiController.cs deleted file mode 100644 index 511f63c8..00000000 --- a/samples/react/MusicStore/Apis/AlbumsApiController.cs +++ /dev/null @@ -1,201 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using AutoMapper; -using MusicStore.Models; -using MusicStore.Infrastructure; - -namespace MusicStore.Apis -{ - [Route("api/albums")] - public class AlbumsApiController : Controller - { - private readonly MusicStoreContext _storeContext; - - public AlbumsApiController(MusicStoreContext storeContext) - { - _storeContext = storeContext; - } - - [HttpGet] - [NoCache] - public async Task Paged(int page = 1, int pageSize = 50, string sortBy = null) - { - await _storeContext.Genres.LoadAsync(); - await _storeContext.Artists.LoadAsync(); - - var albums = await _storeContext.Albums - .Include(a => a.Genre) - .Include(a => a.Artist) - .ToPagedListAsync(page, pageSize, sortBy, - a => a.Title, // sortExpression - SortDirection.Ascending, // defaultSortDirection - a => Mapper.Map(a, new AlbumResultDto())); // selector - - return Json(albums); - } - - [HttpGet("all")] - [NoCache] - public async Task All() - { - var albums = await _storeContext.Albums - .Include(a => a.Genre) - .Include(a => a.Artist) - .OrderBy(a => a.Title) - .ToListAsync(); - - return Json(albums.Select(a => Mapper.Map(a, new AlbumResultDto()))); - } - - [HttpGet("mostPopular")] - [NoCache] - public async Task MostPopular(int count = 6) - { - count = count > 0 && count < 20 ? count : 6; - var albums = await _storeContext.Albums - .OrderByDescending(a => a.OrderDetails.Count()) - .Take(count) - .ToListAsync(); - - // TODO: Move the .Select() to end of albums query when EF supports it - return Json(albums.Select(a => Mapper.Map(a, new AlbumResultDto()))); - } - - [HttpGet("{albumId:int}")] - [NoCache] - public async Task Details(int albumId) - { - await _storeContext.Genres.LoadAsync(); - await _storeContext.Artists.LoadAsync(); - - var album = await _storeContext.Albums - .Include(a => a.Artist) - .Include(a => a.Genre) - .Where(a => a.AlbumId == albumId) - .SingleOrDefaultAsync(); - - var albumResult = Mapper.Map(album, new AlbumResultDto()); - - // TODO: Add null checking and return 404 in that case - - return Json(albumResult); - } - - [HttpPost] - [Authorize("app-ManageStore")] - public async Task CreateAlbum([FromBody]AlbumChangeDto album) - { - if (!ModelState.IsValid) - { - // Return the model errors - return BadRequest(ModelState); - } - - // Save the changes to the DB - var dbAlbum = new Album(); - _storeContext.Albums.Add(Mapper.Map(album, dbAlbum)); - await _storeContext.SaveChangesAsync(); - - // TODO: Handle missing record, key violations, concurrency issues, etc. - - return new ObjectResult(new { - Data = dbAlbum.AlbumId, - Message = "Album created successfully." - }); - } - - [HttpPut("{albumId:int}/update")] - public async Task UpdateAlbum(int albumId, [FromBody] AlbumChangeDto album) - { - if (!ModelState.IsValid) - { - // Return the model errors - return BadRequest(ModelState); - } - - var dbAlbum = await _storeContext.Albums.SingleOrDefaultAsync(a => a.AlbumId == albumId); - - if (dbAlbum == null) - { - return new ObjectResult(new { - Message = string.Format("The album with ID {0} was not found.", albumId) - }) { StatusCode = 404 }; - } - - // Save the changes to the DB - Mapper.Map(album, dbAlbum); - await _storeContext.SaveChangesAsync(); - - // TODO: Handle missing record, key violations, concurrency issues, etc. - - return new ObjectResult (new { - Message = "Album updated successfully." - }); - } - - [HttpDelete("{albumId:int}")] - [Authorize("app-ManageStore")] - public async Task DeleteAlbum(int albumId) - { - var album = await _storeContext.Albums.SingleOrDefaultAsync(a => a.AlbumId == albumId); - - if (album != null) - { - _storeContext.Albums.Remove(album); - - // Save the changes to the DB - await _storeContext.SaveChangesAsync(); - - // TODO: Handle missing record, key violations, concurrency issues, etc. - } - - return new ObjectResult (new { - Message = "Album deleted successfully." - }); - } - } - - [ModelMetadataType(typeof(Album))] - public class AlbumChangeDto - { - public int GenreId { get; set; } - - public int ArtistId { get; set; } - - public string Title { get; set; } - - public decimal Price { get; set; } - - public string AlbumArtUrl { get; set; } - } - - public class AlbumResultDto : AlbumChangeDto - { - public AlbumResultDto() - { - Artist = new ArtistResultDto(); - Genre = new GenreResultDto(); - } - - public int AlbumId { get; set; } - - public ArtistResultDto Artist { get; private set; } - - public GenreResultDto Genre { get; private set; } - } - - public class ArtistResultDto - { - public string Name { get; set; } - } - - public class GenreResultDto - { - public string Name { get; set; } - } -} diff --git a/samples/react/MusicStore/Apis/ArtistsApiController.cs b/samples/react/MusicStore/Apis/ArtistsApiController.cs deleted file mode 100644 index f3568aeb..00000000 --- a/samples/react/MusicStore/Apis/ArtistsApiController.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using MusicStore.Models; - -namespace MusicStore.Apis -{ - [Route("api/artists")] - public class ArtistsApiController : Controller - { - private readonly MusicStoreContext _storeContext; - - public ArtistsApiController(MusicStoreContext storeContext) - { - _storeContext = storeContext; - } - - [HttpGet("lookup")] - public async Task Lookup() - { - var artists = await _storeContext.Artists - .OrderBy(a => a.Name) - .ToListAsync(); - - return Json(artists); - } - } -} diff --git a/samples/react/MusicStore/Apis/GenresApiController.cs b/samples/react/MusicStore/Apis/GenresApiController.cs deleted file mode 100644 index 338ca2fc..00000000 --- a/samples/react/MusicStore/Apis/GenresApiController.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using MusicStore.Models; -using MusicStore.Infrastructure; - -namespace MusicStore.Apis -{ - [Route("api/genres")] - public class GenresApiController : Controller - { - private readonly MusicStoreContext _storeContext; - - public GenresApiController(MusicStoreContext storeContext) - { - _storeContext = storeContext; - } - - [HttpGet] - public async Task GenreList() - { - var genres = await _storeContext.Genres - //.Include(g => g.Albums) - .OrderBy(g => g.Name) - .ToListAsync(); - - return Json(genres); - } - - [HttpGet("genre-lookup")] - public async Task Lookup() - { - var genres = await _storeContext.Genres - .Select(g => new { g.GenreId, g.Name }) - .ToListAsync(); - - return Json(genres); - } - - [HttpGet("menu")] - public async Task GenreMenuList(int count = 9) - { - count = count > 0 && count < 20 ? count : 9; - - var genres = await _storeContext.Genres - .OrderByDescending(g => - g.Albums.Sum(a => - a.OrderDetails.Sum(od => od.Quantity))) - .Take(count) - .ToListAsync(); - - return Json(genres); - } - - [HttpGet("{genreId:int}/albums")] - [NoCache] - public async Task GenreAlbums(int genreId) - { - var albums = await _storeContext.Albums - .Where(a => a.GenreId == genreId) - //.Include(a => a.Genre) - //.Include(a => a.Artist) - //.OrderBy(a => a.Genre.Name) - .ToListAsync(); - - return Json(albums); - } - } -} diff --git a/samples/react/MusicStore/Apis/Models/AccountViewModels.cs b/samples/react/MusicStore/Apis/Models/AccountViewModels.cs deleted file mode 100644 index 831978a5..00000000 --- a/samples/react/MusicStore/Apis/Models/AccountViewModels.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace MusicStore.Models -{ - public class ExternalLoginConfirmationViewModel - { - [Required] - [Display(Name = "User name")] - public string UserName { get; set; } - } - - public class ManageUserViewModel - { - [Required] - [DataType(DataType.Password)] - [Display(Name = "Current password")] - public string OldPassword { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "New password")] - public string NewPassword { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm new password")] - [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } - - public class LoginViewModel - { - [Required] - [Display(Name = "User name")] - public string UserName { get; set; } - - [Required] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [Display(Name = "Remember me?")] - public bool RememberMe { get; set; } - } - - public class RegisterViewModel - { - [Required] - [Display(Name = "User name")] - public string UserName { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm password")] - [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } -} diff --git a/samples/react/MusicStore/Apis/Models/Album.cs b/samples/react/MusicStore/Apis/Models/Album.cs deleted file mode 100644 index 68e26ff9..00000000 --- a/samples/react/MusicStore/Apis/Models/Album.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; - -namespace MusicStore.Models -{ - public class Album - { - public Album() - { - // TODO: Temporary hack to populate the orderdetails until EF does this automatically. - OrderDetails = new List(); - } - - [ScaffoldColumn(false)] - public int AlbumId { get; set; } - - public int GenreId { get; set; } - - public int ArtistId { get; set; } - - [Required] - [StringLength(160, MinimumLength = 2)] - public string Title { get; set; } - - [Required] - [RangeAttribute(typeof(double), "0.01", "100")] // Long-form constructor to work around https://github.com/dotnet/coreclr/issues/2172 - [DataType(DataType.Currency)] - public decimal Price { get; set; } - - [Display(Name = "Album Art URL")] - [StringLength(1024)] - public string AlbumArtUrl { get; set; } - - public virtual Genre Genre { get; set; } - - public virtual Artist Artist { get; set; } - - public virtual ICollection OrderDetails { get; set; } - } -} diff --git a/samples/react/MusicStore/Apis/Models/Artist.cs b/samples/react/MusicStore/Apis/Models/Artist.cs deleted file mode 100644 index b364a898..00000000 --- a/samples/react/MusicStore/Apis/Models/Artist.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace MusicStore.Models -{ - public class Artist - { - public int ArtistId { get; set; } - - [Required] - public string Name { get; set; } - } -} diff --git a/samples/react/MusicStore/Apis/Models/CartItem.cs b/samples/react/MusicStore/Apis/Models/CartItem.cs deleted file mode 100644 index 7209462d..00000000 --- a/samples/react/MusicStore/Apis/Models/CartItem.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; - -namespace MusicStore.Models -{ - public class CartItem - { - [Key] - public int CartItemId { get; set; } - - [Required] - public string CartId { get; set; } - public int AlbumId { get; set; } - public int Count { get; set; } - - [DataType(DataType.DateTime)] - public DateTime DateCreated { get; set; } - - public virtual Album Album { get; set; } - } -} diff --git a/samples/react/MusicStore/Apis/Models/Genre.cs b/samples/react/MusicStore/Apis/Models/Genre.cs deleted file mode 100644 index eed5616c..00000000 --- a/samples/react/MusicStore/Apis/Models/Genre.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Newtonsoft.Json; - -namespace MusicStore.Models -{ - public class Genre - { - public Genre() - { - Albums = new List(); - } - - public int GenreId { get; set; } - - [Required] - public string Name { get; set; } - - public string Description { get; set; } - - [JsonIgnore] - public virtual ICollection Albums { get; set; } - } -} diff --git a/samples/react/MusicStore/Apis/Models/MusicStoreContext.cs b/samples/react/MusicStore/Apis/Models/MusicStoreContext.cs deleted file mode 100644 index aee7aedd..00000000 --- a/samples/react/MusicStore/Apis/Models/MusicStoreContext.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; - -namespace MusicStore.Models -{ - public class ApplicationUser : IdentityUser { } - - public class MusicStoreContext : IdentityDbContext - { - public MusicStoreContext(DbContextOptions options) : base(options) - { - } - - public DbSet Albums { get; set; } - public DbSet Artists { get; set; } - public DbSet Orders { get; set; } - public DbSet Genres { get; set; } - public DbSet CartItems { get; set; } - public DbSet OrderDetails { get; set; } - - protected override void OnModelCreating(ModelBuilder builder) - { - // Configure pluralization - builder.Entity().ToTable("Albums"); - builder.Entity().ToTable("Artists"); - builder.Entity().ToTable("Orders"); - builder.Entity().ToTable("Genres"); - builder.Entity().ToTable("CartItems"); - builder.Entity().ToTable("OrderDetails"); - - base.OnModelCreating(builder); - } - } -} diff --git a/samples/react/MusicStore/Apis/Models/Order.cs b/samples/react/MusicStore/Apis/Models/Order.cs deleted file mode 100644 index 110a77d8..00000000 --- a/samples/react/MusicStore/Apis/Models/Order.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; - -namespace MusicStore.Models -{ - //[Bind(Include = "FirstName,LastName,Address,City,State,PostalCode,Country,Phone,Email")] - public class Order - { - public Order() - { - OrderDetails = new List(); - } - - [ScaffoldColumn(false)] - public int OrderId { get; set; } - - [ScaffoldColumn(false)] - public DateTime OrderDate { get; set; } - - [Required] - [ScaffoldColumn(false)] - public string Username { get; set; } - - [Required] - [Display(Name = "First Name")] - [StringLength(160)] - public string FirstName { get; set; } - - [Required] - [Display(Name = "Last Name")] - [StringLength(160)] - public string LastName { get; set; } - - [Required] - [StringLength(70, MinimumLength = 3)] - public string Address { get; set; } - - [Required] - [StringLength(40)] - public string City { get; set; } - - [Required] - [StringLength(40)] - public string State { get; set; } - - [Required] - [Display(Name = "Postal Code")] - [StringLength(10, MinimumLength = 5)] - public string PostalCode { get; set; } - - [Required] - [StringLength(40)] - public string Country { get; set; } - - [Required] - [StringLength(24)] - [DataType(DataType.PhoneNumber)] - public string Phone { get; set; } - - [Required] - [Display(Name = "Email Address")] - [RegularExpression(@"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}", - ErrorMessage = "Email is not valid.")] - [DataType(DataType.EmailAddress)] - public string Email { get; set; } - - [ScaffoldColumn(false)] - public decimal Total { get; set; } - - public ICollection OrderDetails { get; set; } - } -} diff --git a/samples/react/MusicStore/Apis/Models/OrderDetail.cs b/samples/react/MusicStore/Apis/Models/OrderDetail.cs deleted file mode 100644 index cb1e6930..00000000 --- a/samples/react/MusicStore/Apis/Models/OrderDetail.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace MusicStore.Models -{ - public class OrderDetail - { - public int OrderDetailId { get; set; } - public int OrderId { get; set; } - public int AlbumId { get; set; } - public int Quantity { get; set; } - public decimal UnitPrice { get; set; } - - public virtual Album Album { get; set; } - public virtual Order Order { get; set; } - } -} diff --git a/samples/react/MusicStore/Apis/Models/SampleData.cs b/samples/react/MusicStore/Apis/Models/SampleData.cs deleted file mode 100644 index b1d98a7c..00000000 --- a/samples/react/MusicStore/Apis/Models/SampleData.cs +++ /dev/null @@ -1,915 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; - -namespace MusicStore.Models -{ - public static class SampleData - { - const string imgUrl = "/images/placeholder.png"; - - public static async Task InitializeMusicStoreDatabaseAsync(IServiceProvider serviceProvider) - { - using (var db = serviceProvider.GetService()) - { - if (await db.Database.EnsureCreatedAsync()) - { - await InsertTestData(serviceProvider); - } - } - } - - private static async Task InsertTestData(IServiceProvider serviceProvider) - { - var albums = GetAlbums(imgUrl, Genres, Artists); - await AddOrUpdateAsync(serviceProvider, g => g.GenreId, Genres.Select(genre => genre.Value)); - await AddOrUpdateAsync(serviceProvider, a => a.ArtistId, Artists.Select(artist => artist.Value)); - await AddOrUpdateAsync(serviceProvider, a => a.AlbumId, albums); - } - - // TODO [EF] This may be replaced by a first class mechanism in EF - private static async Task AddOrUpdateAsync( - IServiceProvider serviceProvider, - Func propertyToMatch, IEnumerable entities) - where TEntity : class - { - // Query in a separate context so that we can attach existing entities as modified - List existingData; - - using (var scope = serviceProvider.GetRequiredService().CreateScope()) - using (var db = scope.ServiceProvider.GetService()) - { - existingData = db.Set().ToList(); - } - - using (var scope = serviceProvider.GetRequiredService().CreateScope()) - using (var db = scope.ServiceProvider.GetService()) - { - foreach (var item in entities) - { - db.Entry(item).State = existingData.Any(g => propertyToMatch(g).Equals(propertyToMatch(item))) - ? EntityState.Modified - : EntityState.Added; - } - - await db.SaveChangesAsync(); - } - } - - private static Album[] GetAlbums(string imgUrl, Dictionary genres, Dictionary artists) - { - var albums = new Album[] - { - new Album { Title = "The Best Of The Men At Work", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Men At Work"], AlbumArtUrl = imgUrl }, - new Album { Title = "...And Justice For All", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "עד גבול האור", Genre = genres["World"], Price = 8.99M, Artist = artists["אריק אינשטיין"], AlbumArtUrl = imgUrl }, - new Album { Title = "Black Light Syndrome", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Terry Bozzio, Tony Levin & Steve Stevens"], AlbumArtUrl = imgUrl }, - new Album { Title = "10,000 Days", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Tool"], AlbumArtUrl = imgUrl }, - new Album { Title = "11i", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Supreme Beings of Leisure"], AlbumArtUrl = imgUrl }, - new Album { Title = "1960", Genre = genres["Indie"], Price = 8.99M, Artist = artists["Soul-Junk"], AlbumArtUrl = imgUrl }, - new Album { Title = "4x4=12 ", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["deadmau5"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Copland Celebration, Vol. I", Genre = genres["Classical"], Price = 8.99M, Artist = artists["London Symphony Orchestra"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Lively Mind", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Paul Oakenfold"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Matter of Life and Death", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Real Dead One", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Real Live One", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Rush of Blood to the Head", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Coldplay"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Soprano Inspired", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Britten Sinfonia, Ivor Bolton & Lesley Garrett"], AlbumArtUrl = imgUrl }, - new Album { Title = "A Winter Symphony", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "Abbey Road", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Beatles"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ace Of Spades", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Motörhead"], AlbumArtUrl = imgUrl }, - new Album { Title = "Achtung Baby", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "Acústico MTV", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Os Paralamas Do Sucesso"], AlbumArtUrl = imgUrl }, - new Album { Title = "Adams, John: The Chairman Dances", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Edo de Waart & San Francisco Symphony"], AlbumArtUrl = imgUrl }, - new Album { Title = "Adrenaline", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deftones"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ænima", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Tool"], AlbumArtUrl = imgUrl }, - new Album { Title = "Afrociberdelia", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Chico Science & Nação Zumbi"], AlbumArtUrl = imgUrl }, - new Album { Title = "After the Goldrush", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Neil Young"], AlbumArtUrl = imgUrl }, - new Album { Title = "Airdrawn Dagger", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Sasha"], AlbumArtUrl = imgUrl }, - new Album { Title = "Album Title Goes Here", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["deadmau5"], AlbumArtUrl = imgUrl }, - new Album { Title = "Alcohol Fueled Brewtality Live! [Disc 1]", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Black Label Society"], AlbumArtUrl = imgUrl }, - new Album { Title = "Alcohol Fueled Brewtality Live! [Disc 2]", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Black Label Society"], AlbumArtUrl = imgUrl }, - new Album { Title = "Alive 2007", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Daft Punk"], AlbumArtUrl = imgUrl }, - new Album { Title = "All I Ask of You", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "Amen (So Be It)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Paddy Casey"], AlbumArtUrl = imgUrl }, - new Album { Title = "Animal Vehicle", Genre = genres["Pop"], Price = 8.99M, Artist = artists["The Axis of Awesome"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ao Vivo [IMPORT]", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Zeca Pagodinho"], AlbumArtUrl = imgUrl }, - new Album { Title = "Apocalyptic Love", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Slash"], AlbumArtUrl = imgUrl }, - new Album { Title = "Appetite for Destruction", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Guns N' Roses"], AlbumArtUrl = imgUrl }, - new Album { Title = "Are You Experienced?", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Jimi Hendrix"], AlbumArtUrl = imgUrl }, - new Album { Title = "Arquivo II", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Os Paralamas Do Sucesso"], AlbumArtUrl = imgUrl }, - new Album { Title = "Arquivo Os Paralamas Do Sucesso", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Os Paralamas Do Sucesso"], AlbumArtUrl = imgUrl }, - new Album { Title = "A-Sides", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Soundgarden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Audioslave", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Audioslave"], AlbumArtUrl = imgUrl }, - new Album { Title = "Automatic for the People", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["R.E.M."], AlbumArtUrl = imgUrl }, - new Album { Title = "Axé Bahia 2001", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Various Artists"], AlbumArtUrl = imgUrl }, - new Album { Title = "Babel", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Mumford & Sons"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bach: Goldberg Variations", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Wilhelm Kempff"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bach: The Brandenburg Concertos", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Orchestra of The Age of Enlightenment"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bach: The Cello Suites", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Yo-Yo Ma"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bach: Toccata & Fugue in D Minor", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Ton Koopman"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bad Motorfinger", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Soundgarden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Balls to the Wall", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Accept"], AlbumArtUrl = imgUrl }, - new Album { Title = "Banadeek Ta'ala", Genre = genres["World"], Price = 8.99M, Artist = artists["Amr Diab"], AlbumArtUrl = imgUrl }, - new Album { Title = "Barbie Girl", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Aqua"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bark at the Moon (Remastered)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Ozzy Osbourne"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bartok: Violin & Viola Concertos", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Yehudi Menuhin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Barulhinho Bom", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Marisa Monte"], AlbumArtUrl = imgUrl }, - new Album { Title = "BBC Sessions [Disc 1] [Live]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "BBC Sessions [Disc 2] [Live]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Be Here Now", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Oasis"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bedrock 11 Compiled & Mixed", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["John Digweed"], AlbumArtUrl = imgUrl }, - new Album { Title = "Berlioz: Symphonie Fantastique", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Michael Tilson Thomas"], AlbumArtUrl = imgUrl }, - new Album { Title = "Beyond Good And Evil", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Cult"], AlbumArtUrl = imgUrl }, - new Album { Title = "Big Bad Wolf ", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Armand Van Helden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Big Ones", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Aerosmith"], AlbumArtUrl = imgUrl }, - new Album { Title = "Black Album", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Black Sabbath Vol. 4 (Remaster)", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Black Sabbath"], AlbumArtUrl = imgUrl }, - new Album { Title = "Black Sabbath", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Black Sabbath"], AlbumArtUrl = imgUrl }, - new Album { Title = "Black", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Blackwater Park", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Opeth"], AlbumArtUrl = imgUrl }, - new Album { Title = "Blizzard of Ozz", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Ozzy Osbourne"], AlbumArtUrl = imgUrl }, - new Album { Title = "Blood", Genre = genres["Rock"], Price = 8.99M, Artist = artists["In This Moment"], AlbumArtUrl = imgUrl }, - new Album { Title = "Blue Moods", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Incognito"], AlbumArtUrl = imgUrl }, - new Album { Title = "Blue", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Weezer"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bongo Fury", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Frank Zappa & Captain Beefheart"], AlbumArtUrl = imgUrl }, - new Album { Title = "Boys & Girls", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Alabama Shakes"], AlbumArtUrl = imgUrl }, - new Album { Title = "Brave New World", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "B-Sides 1980-1990", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "Bunkka", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Paul Oakenfold"], AlbumArtUrl = imgUrl }, - new Album { Title = "By The Way", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Red Hot Chili Peppers"], AlbumArtUrl = imgUrl }, - new Album { Title = "Cake: B-Sides and Rarities", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Cake"], AlbumArtUrl = imgUrl }, - new Album { Title = "Californication", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Red Hot Chili Peppers"], AlbumArtUrl = imgUrl }, - new Album { Title = "Carmina Burana", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Boston Symphony Orchestra & Seiji Ozawa"], AlbumArtUrl = imgUrl }, - new Album { Title = "Carried to Dust (Bonus Track Version)", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Calexico"], AlbumArtUrl = imgUrl }, - new Album { Title = "Carry On", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Chris Cornell"], AlbumArtUrl = imgUrl }, - new Album { Title = "Cássia Eller - Sem Limite [Disc 1]", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Cássia Eller"], AlbumArtUrl = imgUrl }, - new Album { Title = "Chemical Wedding", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Bruce Dickinson"], AlbumArtUrl = imgUrl }, - new Album { Title = "Chill: Brazil (Disc 1)", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Marcos Valle"], AlbumArtUrl = imgUrl }, - new Album { Title = "Chill: Brazil (Disc 2)", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Antônio Carlos Jobim"], AlbumArtUrl = imgUrl }, - new Album { Title = "Chocolate Starfish And The Hot Dog Flavored Water", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Limp Bizkit"], AlbumArtUrl = imgUrl }, - new Album { Title = "Chronicle, Vol. 1", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Creedence Clearwater Revival"], AlbumArtUrl = imgUrl }, - new Album { Title = "Chronicle, Vol. 2", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Creedence Clearwater Revival"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ciao, Baby", Genre = genres["Rock"], Price = 8.99M, Artist = artists["TheStart"], AlbumArtUrl = imgUrl }, - new Album { Title = "Cidade Negra - Hits", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Cidade Negra"], AlbumArtUrl = imgUrl }, - new Album { Title = "Classic Munkle: Turbo Edition", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Munkle"], AlbumArtUrl = imgUrl }, - new Album { Title = "Classics: The Best of Sarah Brightman", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "Coda", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Come Away With Me", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Norah Jones"], AlbumArtUrl = imgUrl }, - new Album { Title = "Come Taste The Band", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Comfort Eagle", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Cake"], AlbumArtUrl = imgUrl }, - new Album { Title = "Common Reaction", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Uh Huh Her "], AlbumArtUrl = imgUrl }, - new Album { Title = "Compositores", Genre = genres["Rock"], Price = 8.99M, Artist = artists["O Terço"], AlbumArtUrl = imgUrl }, - new Album { Title = "Contraband", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Velvet Revolver"], AlbumArtUrl = imgUrl }, - new Album { Title = "Core", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Stone Temple Pilots"], AlbumArtUrl = imgUrl }, - new Album { Title = "Cornerstone", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Styx"], AlbumArtUrl = imgUrl }, - new Album { Title = "Cosmicolor", Genre = genres["Rap"], Price = 8.99M, Artist = artists["M-Flo"], AlbumArtUrl = imgUrl }, - new Album { Title = "Cross", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Justice"], AlbumArtUrl = imgUrl }, - new Album { Title = "Culture of Fear", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Thievery Corporation"], AlbumArtUrl = imgUrl }, - new Album { Title = "Da Lama Ao Caos", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Chico Science & Nação Zumbi"], AlbumArtUrl = imgUrl }, - new Album { Title = "Dakshina", Genre = genres["World"], Price = 8.99M, Artist = artists["Deva Premal"], AlbumArtUrl = imgUrl }, - new Album { Title = "Dark Side of the Moon", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pink Floyd"], AlbumArtUrl = imgUrl }, - new Album { Title = "Death Magnetic", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Deep End of Down", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Above the Fold"], AlbumArtUrl = imgUrl }, - new Album { Title = "Deep Purple In Rock", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Deixa Entrar", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Falamansa"], AlbumArtUrl = imgUrl }, - new Album { Title = "Deja Vu", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Crosby, Stills, Nash, and Young"], AlbumArtUrl = imgUrl }, - new Album { Title = "Di Korpu Ku Alma", Genre = genres["World"], Price = 8.99M, Artist = artists["Lura"], AlbumArtUrl = imgUrl }, - new Album { Title = "Diary of a Madman (Remastered)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Ozzy Osbourne"], AlbumArtUrl = imgUrl }, - new Album { Title = "Diary of a Madman", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Ozzy Osbourne"], AlbumArtUrl = imgUrl }, - new Album { Title = "Dirt", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Alice in Chains"], AlbumArtUrl = imgUrl }, - new Album { Title = "Diver Down", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Van Halen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Djavan Ao Vivo - Vol. 02", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Djavan"], AlbumArtUrl = imgUrl }, - new Album { Title = "Djavan Ao Vivo - Vol. 1", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Djavan"], AlbumArtUrl = imgUrl }, - new Album { Title = "Drum'n'bass for Papa", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Plug"], AlbumArtUrl = imgUrl }, - new Album { Title = "Duluth", Genre = genres["Country"], Price = 8.99M, Artist = artists["Trampled By Turtles"], AlbumArtUrl = imgUrl }, - new Album { Title = "Dummy", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Portishead"], AlbumArtUrl = imgUrl }, - new Album { Title = "Duos II", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Luciana Souza/Romero Lubambo"], AlbumArtUrl = imgUrl }, - new Album { Title = "Earl Scruggs and Friends", Genre = genres["Country"], Price = 8.99M, Artist = artists["Earl Scruggs"], AlbumArtUrl = imgUrl }, - new Album { Title = "Eden", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "El Camino", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Black Keys"], AlbumArtUrl = imgUrl }, - new Album { Title = "Elegant Gypsy", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Al di Meola"], AlbumArtUrl = imgUrl }, - new Album { Title = "Elements Of Life", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Tiësto"], AlbumArtUrl = imgUrl }, - new Album { Title = "Elis Regina-Minha História", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Elis Regina"], AlbumArtUrl = imgUrl }, - new Album { Title = "Emergency On Planet Earth", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Jamiroquai"], AlbumArtUrl = imgUrl }, - new Album { Title = "Emotion", Genre = genres["World"], Price = 8.99M, Artist = artists["Papa Wemba"], AlbumArtUrl = imgUrl }, - new Album { Title = "English Renaissance", Genre = genres["Classical"], Price = 8.99M, Artist = artists["The King's Singers"], AlbumArtUrl = imgUrl }, - new Album { Title = "Every Kind of Light", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Posies"], AlbumArtUrl = imgUrl }, - new Album { Title = "Faceless", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Godsmack"], AlbumArtUrl = imgUrl }, - new Album { Title = "Facelift", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Alice in Chains"], AlbumArtUrl = imgUrl }, - new Album { Title = "Fair Warning", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Van Halen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Fear of a Black Planet", Genre = genres["Rap"], Price = 8.99M, Artist = artists["Public Enemy"], AlbumArtUrl = imgUrl }, - new Album { Title = "Fear Of The Dark", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Feels Like Home", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Norah Jones"], AlbumArtUrl = imgUrl }, - new Album { Title = "Fireball", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Fly", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "For Those About To Rock We Salute You", Genre = genres["Rock"], Price = 8.99M, Artist = artists["AC/DC"], AlbumArtUrl = imgUrl }, - new Album { Title = "Four", Genre = genres["Blues"], Price = 8.99M, Artist = artists["Blues Traveler"], AlbumArtUrl = imgUrl }, - new Album { Title = "Frank", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Amy Winehouse"], AlbumArtUrl = imgUrl }, - new Album { Title = "Further Down the Spiral", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Nine Inch Nails"], AlbumArtUrl = imgUrl }, - new Album { Title = "Garage Inc. (Disc 1)", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Garage Inc. (Disc 2)", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Garbage", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Garbage"], AlbumArtUrl = imgUrl }, - new Album { Title = "Good News For People Who Love Bad News", Genre = genres["Indie"], Price = 8.99M, Artist = artists["Modest Mouse"], AlbumArtUrl = imgUrl }, - new Album { Title = "Gordon", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Barenaked Ladies"], AlbumArtUrl = imgUrl }, - new Album { Title = "Górecki: Symphony No. 3", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Adrian Leaper & Doreen de Feis"], AlbumArtUrl = imgUrl }, - new Album { Title = "Greatest Hits I", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Queen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Greatest Hits II", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Queen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Greatest Hits", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Duck Sauce"], AlbumArtUrl = imgUrl }, - new Album { Title = "Greatest Hits", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Lenny Kravitz"], AlbumArtUrl = imgUrl }, - new Album { Title = "Greatest Hits", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Lenny Kravitz"], AlbumArtUrl = imgUrl }, - new Album { Title = "Greatest Kiss", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Kiss"], AlbumArtUrl = imgUrl }, - new Album { Title = "Greetings from Michigan", Genre = genres["Indie"], Price = 8.99M, Artist = artists["Sufjan Stevens"], AlbumArtUrl = imgUrl }, - new Album { Title = "Group Therapy", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Above & Beyond"], AlbumArtUrl = imgUrl }, - new Album { Title = "Handel: The Messiah (Highlights)", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Scholars Baroque Ensemble"], AlbumArtUrl = imgUrl }, - new Album { Title = "Haydn: Symphonies 99 - 104", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Royal Philharmonic Orchestra"], AlbumArtUrl = imgUrl }, - new Album { Title = "Heart of the Night", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Spyro Gyra"], AlbumArtUrl = imgUrl }, - new Album { Title = "Heart On", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Eagles of Death Metal"], AlbumArtUrl = imgUrl }, - new Album { Title = "Holy Diver", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Dio"], AlbumArtUrl = imgUrl }, - new Album { Title = "Homework", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Daft Punk"], AlbumArtUrl = imgUrl }, - new Album { Title = "Hot Rocks, 1964-1971 (Disc 1)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Rolling Stones"], AlbumArtUrl = imgUrl }, - new Album { Title = "Houses Of The Holy", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "How To Dismantle An Atomic Bomb", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "Human", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Projected"], AlbumArtUrl = imgUrl }, - new Album { Title = "Hunky Dory", Genre = genres["Rock"], Price = 8.99M, Artist = artists["David Bowie"], AlbumArtUrl = imgUrl }, - new Album { Title = "Hymns", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Projected"], AlbumArtUrl = imgUrl }, - new Album { Title = "Hysteria", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Def Leppard"], AlbumArtUrl = imgUrl }, - new Album { Title = "In Absentia", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Porcupine Tree"], AlbumArtUrl = imgUrl }, - new Album { Title = "In Between", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Paul Van Dyk"], AlbumArtUrl = imgUrl }, - new Album { Title = "In Rainbows", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Radiohead"], AlbumArtUrl = imgUrl }, - new Album { Title = "In Step", Genre = genres["Blues"], Price = 8.99M, Artist = artists["Stevie Ray Vaughan & Double Trouble"], AlbumArtUrl = imgUrl }, - new Album { Title = "In the court of the Crimson King", Genre = genres["Rock"], Price = 8.99M, Artist = artists["King Crimson"], AlbumArtUrl = imgUrl }, - new Album { Title = "In Through The Out Door", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "In Your Honor [Disc 1]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Foo Fighters"], AlbumArtUrl = imgUrl }, - new Album { Title = "In Your Honor [Disc 2]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Foo Fighters"], AlbumArtUrl = imgUrl }, - new Album { Title = "Indestructible", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Rancid"], AlbumArtUrl = imgUrl }, - new Album { Title = "Infinity", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Journey"], AlbumArtUrl = imgUrl }, - new Album { Title = "Into The Light", Genre = genres["Rock"], Price = 8.99M, Artist = artists["David Coverdale"], AlbumArtUrl = imgUrl }, - new Album { Title = "Introspective", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Pet Shop Boys"], AlbumArtUrl = imgUrl }, - new Album { Title = "Iron Maiden", Genre = genres["Blues"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "ISAM", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Amon Tobin"], AlbumArtUrl = imgUrl }, - new Album { Title = "IV", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Jagged Little Pill", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Alanis Morissette"], AlbumArtUrl = imgUrl }, - new Album { Title = "Jagged Little Pill", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Alanis Morissette"], AlbumArtUrl = imgUrl }, - new Album { Title = "Jorge Ben Jor 25 Anos", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Jorge Ben"], AlbumArtUrl = imgUrl }, - new Album { Title = "Jota Quest-1995", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Jota Quest"], AlbumArtUrl = imgUrl }, - new Album { Title = "Kick", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["INXS"], AlbumArtUrl = imgUrl }, - new Album { Title = "Kill 'Em All", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Kind of Blue", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Miles Davis"], AlbumArtUrl = imgUrl }, - new Album { Title = "King For A Day Fool For A Lifetime", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Faith No More"], AlbumArtUrl = imgUrl }, - new Album { Title = "Kiss", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Carly Rae Jepsen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Last Call", Genre = genres["Country"], Price = 8.99M, Artist = artists["Cayouche"], AlbumArtUrl = imgUrl }, - new Album { Title = "Le Freak", Genre = genres["R&B"], Price = 8.99M, Artist = artists["Chic"], AlbumArtUrl = imgUrl }, - new Album { Title = "Le Tigre", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Le Tigre"], AlbumArtUrl = imgUrl }, - new Album { Title = "Led Zeppelin I", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Led Zeppelin II", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Led Zeppelin III", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Let There Be Rock", Genre = genres["Rock"], Price = 8.99M, Artist = artists["AC/DC"], AlbumArtUrl = imgUrl }, - new Album { Title = "Little Earthquakes", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Tori Amos"], AlbumArtUrl = imgUrl }, - new Album { Title = "Live [Disc 1]", Genre = genres["Blues"], Price = 8.99M, Artist = artists["The Black Crowes"], AlbumArtUrl = imgUrl }, - new Album { Title = "Live [Disc 2]", Genre = genres["Blues"], Price = 8.99M, Artist = artists["The Black Crowes"], AlbumArtUrl = imgUrl }, - new Album { Title = "Live After Death", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Live At Donington 1992 (Disc 1)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Live At Donington 1992 (Disc 2)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Live on Earth", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["The Cat Empire"], AlbumArtUrl = imgUrl }, - new Album { Title = "Live On Two Legs [Live]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pearl Jam"], AlbumArtUrl = imgUrl }, - new Album { Title = "Living After Midnight", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Judas Priest"], AlbumArtUrl = imgUrl }, - new Album { Title = "Living", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Paddy Casey"], AlbumArtUrl = imgUrl }, - new Album { Title = "Load", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Love Changes Everything", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "MacArthur Park Suite", Genre = genres["R&B"], Price = 8.99M, Artist = artists["Donna Summer"], AlbumArtUrl = imgUrl }, - new Album { Title = "Machine Head", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Magical Mystery Tour", Genre = genres["Pop"], Price = 8.99M, Artist = artists["The Beatles"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mais Do Mesmo", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Legião Urbana"], AlbumArtUrl = imgUrl }, - new Album { Title = "Maquinarama", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Skank"], AlbumArtUrl = imgUrl }, - new Album { Title = "Marasim", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Jagjit Singh"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mascagni: Cavalleria Rusticana", Genre = genres["Classical"], Price = 8.99M, Artist = artists["James Levine"], AlbumArtUrl = imgUrl }, - new Album { Title = "Master of Puppets", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mechanics & Mathematics", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Venus Hum"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mental Jewelry", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Live"], AlbumArtUrl = imgUrl }, - new Album { Title = "Metallics", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "meteora", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Linkin Park"], AlbumArtUrl = imgUrl }, - new Album { Title = "Meus Momentos", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Gonzaguinha"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mezmerize", Genre = genres["Metal"], Price = 8.99M, Artist = artists["System Of A Down"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mezzanine", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Massive Attack"], AlbumArtUrl = imgUrl }, - new Album { Title = "Miles Ahead", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Miles Davis"], AlbumArtUrl = imgUrl }, - new Album { Title = "Milton Nascimento Ao Vivo", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Milton Nascimento"], AlbumArtUrl = imgUrl }, - new Album { Title = "Minas", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Milton Nascimento"], AlbumArtUrl = imgUrl }, - new Album { Title = "Minha Historia", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Chico Buarque"], AlbumArtUrl = imgUrl }, - new Album { Title = "Misplaced Childhood", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Marillion"], AlbumArtUrl = imgUrl }, - new Album { Title = "MK III The Final Concerts [Disc 1]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Morning Dance", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Spyro Gyra"], AlbumArtUrl = imgUrl }, - new Album { Title = "Motley Crue Greatest Hits", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Mötley Crüe"], AlbumArtUrl = imgUrl }, - new Album { Title = "Moving Pictures", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Rush"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mozart: Chamber Music", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Nash Ensemble"], AlbumArtUrl = imgUrl }, - new Album { Title = "Mozart: Symphonies Nos. 40 & 41", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Berliner Philharmoniker"], AlbumArtUrl = imgUrl }, - new Album { Title = "Murder Ballads", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Nick Cave and the Bad Seeds"], AlbumArtUrl = imgUrl }, - new Album { Title = "Music For The Jilted Generation", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["The Prodigy"], AlbumArtUrl = imgUrl }, - new Album { Title = "My Generation - The Very Best Of The Who", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Who"], AlbumArtUrl = imgUrl }, - new Album { Title = "My Name is Skrillex", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Skrillex"], AlbumArtUrl = imgUrl }, - new Album { Title = "Na Pista", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Cláudio Zoli"], AlbumArtUrl = imgUrl }, - new Album { Title = "Nevermind", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Nirvana"], AlbumArtUrl = imgUrl }, - new Album { Title = "New Adventures In Hi-Fi", Genre = genres["Rock"], Price = 8.99M, Artist = artists["R.E.M."], AlbumArtUrl = imgUrl }, - new Album { Title = "New Divide", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Linkin Park"], AlbumArtUrl = imgUrl }, - new Album { Title = "New York Dolls", Genre = genres["Punk"], Price = 8.99M, Artist = artists["New York Dolls"], AlbumArtUrl = imgUrl }, - new Album { Title = "News Of The World", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Queen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Nielsen: The Six Symphonies", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Göteborgs Symfoniker & Neeme Järvi"], AlbumArtUrl = imgUrl }, - new Album { Title = "Night At The Opera", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Queen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Night Castle", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Trans-Siberian Orchestra"], AlbumArtUrl = imgUrl }, - new Album { Title = "Nkolo", Genre = genres["World"], Price = 8.99M, Artist = artists["Lokua Kanza"], AlbumArtUrl = imgUrl }, - new Album { Title = "No More Tears (Remastered)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Ozzy Osbourne"], AlbumArtUrl = imgUrl }, - new Album { Title = "No Prayer For The Dying", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "No Security", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Rolling Stones"], AlbumArtUrl = imgUrl }, - new Album { Title = "O Brother, Where Art Thou?", Genre = genres["Country"], Price = 8.99M, Artist = artists["Alison Krauss"], AlbumArtUrl = imgUrl }, - new Album { Title = "O Samba Poconé", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Skank"], AlbumArtUrl = imgUrl }, - new Album { Title = "O(+>", Genre = genres["R&B"], Price = 8.99M, Artist = artists["Prince"], AlbumArtUrl = imgUrl }, - new Album { Title = "Oceania", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Smashing Pumpkins"], AlbumArtUrl = imgUrl }, - new Album { Title = "Off the Deep End", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Weird Al"], AlbumArtUrl = imgUrl }, - new Album { Title = "OK Computer", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Radiohead"], AlbumArtUrl = imgUrl }, - new Album { Title = "Olodum", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Olodum"], AlbumArtUrl = imgUrl }, - new Album { Title = "One Love", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["David Guetta"], AlbumArtUrl = imgUrl }, - new Album { Title = "Operation: Mindcrime", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Queensrÿche"], AlbumArtUrl = imgUrl }, - new Album { Title = "Opiate", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Tool"], AlbumArtUrl = imgUrl }, - new Album { Title = "Outbreak", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Dennis Chambers"], AlbumArtUrl = imgUrl }, - new Album { Title = "Pachelbel: Canon & Gigue", Genre = genres["Classical"], Price = 8.99M, Artist = artists["English Concert & Trevor Pinnock"], AlbumArtUrl = imgUrl }, - new Album { Title = "Paid in Full", Genre = genres["Rap"], Price = 8.99M, Artist = artists["Eric B. and Rakim"], AlbumArtUrl = imgUrl }, - new Album { Title = "Para Siempre", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Vicente Fernandez"], AlbumArtUrl = imgUrl }, - new Album { Title = "Pause", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Four Tet"], AlbumArtUrl = imgUrl }, - new Album { Title = "Peace Sells... but Who's Buying", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Megadeth"], AlbumArtUrl = imgUrl }, - new Album { Title = "Physical Graffiti [Disc 1]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Physical Graffiti [Disc 2]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Physical Graffiti", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Piece Of Mind", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Pinkerton", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Weezer"], AlbumArtUrl = imgUrl }, - new Album { Title = "Plays Metallica By Four Cellos", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Apocalyptica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Pop", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "Powerslave", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Prenda Minha", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Caetano Veloso"], AlbumArtUrl = imgUrl }, - new Album { Title = "Presence", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Pretty Hate Machine", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Nine Inch Nails"], AlbumArtUrl = imgUrl }, - new Album { Title = "Prisoner", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Jezabels"], AlbumArtUrl = imgUrl }, - new Album { Title = "Privateering", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Mark Knopfler"], AlbumArtUrl = imgUrl }, - new Album { Title = "Prokofiev: Romeo & Juliet", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Michael Tilson Thomas"], AlbumArtUrl = imgUrl }, - new Album { Title = "Prokofiev: Symphony No.1", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sergei Prokofiev & Yuri Temirkanov"], AlbumArtUrl = imgUrl }, - new Album { Title = "PSY's Best 6th Part 1", Genre = genres["Pop"], Price = 8.99M, Artist = artists["PSY"], AlbumArtUrl = imgUrl }, - new Album { Title = "Purcell: The Fairy Queen", Genre = genres["Classical"], Price = 8.99M, Artist = artists["London Classical Players"], AlbumArtUrl = imgUrl }, - new Album { Title = "Purpendicular", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Purple", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Stone Temple Pilots"], AlbumArtUrl = imgUrl }, - new Album { Title = "Quanta Gente Veio Ver (Live)", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Gilberto Gil"], AlbumArtUrl = imgUrl }, - new Album { Title = "Quanta Gente Veio ver--Bônus De Carnaval", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Gilberto Gil"], AlbumArtUrl = imgUrl }, - new Album { Title = "Quiet Songs", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Aisha Duo"], AlbumArtUrl = imgUrl }, - new Album { Title = "Raices", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Los Tigres del Norte"], AlbumArtUrl = imgUrl }, - new Album { Title = "Raising Hell", Genre = genres["Rap"], Price = 8.99M, Artist = artists["Run DMC"], AlbumArtUrl = imgUrl }, - new Album { Title = "Raoul and the Kings of Spain ", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Tears For Fears"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rattle And Hum", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "Raul Seixas", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Raul Seixas"], AlbumArtUrl = imgUrl }, - new Album { Title = "Recovery [Explicit]", Genre = genres["Rap"], Price = 8.99M, Artist = artists["Eminem"], AlbumArtUrl = imgUrl }, - new Album { Title = "Reign In Blood", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Slayer"], AlbumArtUrl = imgUrl }, - new Album { Title = "Relayed", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Yes"], AlbumArtUrl = imgUrl }, - new Album { Title = "ReLoad", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Respighi:Pines of Rome", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Eugene Ormandy"], AlbumArtUrl = imgUrl }, - new Album { Title = "Restless and Wild", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Accept"], AlbumArtUrl = imgUrl }, - new Album { Title = "Retrospective I (1974-1980)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Rush"], AlbumArtUrl = imgUrl }, - new Album { Title = "Revelations", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Audioslave"], AlbumArtUrl = imgUrl }, - new Album { Title = "Revolver", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Beatles"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ride the Lighting ", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ride The Lightning", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ring My Bell", Genre = genres["R&B"], Price = 8.99M, Artist = artists["Anita Ward"], AlbumArtUrl = imgUrl }, - new Album { Title = "Riot Act", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pearl Jam"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rise of the Phoenix", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Before the Dawn"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rock In Rio [CD1]", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rock In Rio [CD2]", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rock In Rio [CD2]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Roda De Funk", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Funk Como Le Gusta"], AlbumArtUrl = imgUrl }, - new Album { Title = "Room for Squares", Genre = genres["Pop"], Price = 8.99M, Artist = artists["John Mayer"], AlbumArtUrl = imgUrl }, - new Album { Title = "Root Down", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Jimmy Smith"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rounds", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Four Tet"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rubber Factory", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Black Keys"], AlbumArtUrl = imgUrl }, - new Album { Title = "Rust in Peace", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Megadeth"], AlbumArtUrl = imgUrl }, - new Album { Title = "Sambas De Enredo 2001", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Various Artists"], AlbumArtUrl = imgUrl }, - new Album { Title = "Santana - As Years Go By", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Santana"], AlbumArtUrl = imgUrl }, - new Album { Title = "Santana Live", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Santana"], AlbumArtUrl = imgUrl }, - new Album { Title = "Saturday Night Fever", Genre = genres["R&B"], Price = 8.99M, Artist = artists["Bee Gees"], AlbumArtUrl = imgUrl }, - new Album { Title = "Scary Monsters and Nice Sprites", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Skrillex"], AlbumArtUrl = imgUrl }, - new Album { Title = "Scheherazade", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Chicago Symphony Orchestra & Fritz Reiner"], AlbumArtUrl = imgUrl }, - new Album { Title = "SCRIABIN: Vers la flamme", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Christopher O'Riley"], AlbumArtUrl = imgUrl }, - new Album { Title = "Second Coming", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Stone Roses"], AlbumArtUrl = imgUrl }, - new Album { Title = "Serie Sem Limite (Disc 1)", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Tim Maia"], AlbumArtUrl = imgUrl }, - new Album { Title = "Serie Sem Limite (Disc 2)", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Tim Maia"], AlbumArtUrl = imgUrl }, - new Album { Title = "Serious About Men", Genre = genres["Rap"], Price = 8.99M, Artist = artists["The Rubberbandits"], AlbumArtUrl = imgUrl }, - new Album { Title = "Seventh Son of a Seventh Son", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Short Bus", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Filter"], AlbumArtUrl = imgUrl }, - new Album { Title = "Sibelius: Finlandia", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Berliner Philharmoniker"], AlbumArtUrl = imgUrl }, - new Album { Title = "Singles Collection", Genre = genres["Rock"], Price = 8.99M, Artist = artists["David Bowie"], AlbumArtUrl = imgUrl }, - new Album { Title = "Six Degrees of Inner Turbulence", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Dream Theater"], AlbumArtUrl = imgUrl }, - new Album { Title = "Slave To The Empire", Genre = genres["Metal"], Price = 8.99M, Artist = artists["T&N"], AlbumArtUrl = imgUrl }, - new Album { Title = "Slaves And Masters", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Slouching Towards Bethlehem", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Robert James"], AlbumArtUrl = imgUrl }, - new Album { Title = "Smash", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Offspring"], AlbumArtUrl = imgUrl }, - new Album { Title = "Something Special", Genre = genres["Country"], Price = 8.99M, Artist = artists["Dolly Parton"], AlbumArtUrl = imgUrl }, - new Album { Title = "Somewhere in Time", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Song(s) You Know By Heart", Genre = genres["Country"], Price = 8.99M, Artist = artists["Jimmy Buffett"], AlbumArtUrl = imgUrl }, - new Album { Title = "Sound of Music", Genre = genres["Punk"], Price = 8.99M, Artist = artists["Adicts"], AlbumArtUrl = imgUrl }, - new Album { Title = "South American Getaway", Genre = genres["Classical"], Price = 8.99M, Artist = artists["The 12 Cellists of The Berlin Philharmonic"], AlbumArtUrl = imgUrl }, - new Album { Title = "Sozinho Remix Ao Vivo", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Caetano Veloso"], AlbumArtUrl = imgUrl }, - new Album { Title = "Speak of the Devil", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Ozzy Osbourne"], AlbumArtUrl = imgUrl }, - new Album { Title = "Spiritual State", Genre = genres["Rap"], Price = 8.99M, Artist = artists["Nujabes"], AlbumArtUrl = imgUrl }, - new Album { Title = "St. Anger", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Metallica"], AlbumArtUrl = imgUrl }, - new Album { Title = "Still Life", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Opeth"], AlbumArtUrl = imgUrl }, - new Album { Title = "Stop Making Sense", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Talking Heads"], AlbumArtUrl = imgUrl }, - new Album { Title = "Stormbringer", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "Stranger than Fiction", Genre = genres["Punk"], Price = 8.99M, Artist = artists["Bad Religion"], AlbumArtUrl = imgUrl }, - new Album { Title = "Strauss: Waltzes", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Eugene Ormandy"], AlbumArtUrl = imgUrl }, - new Album { Title = "Supermodified", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Amon Tobin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Supernatural", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Santana"], AlbumArtUrl = imgUrl }, - new Album { Title = "Surfing with the Alien (Remastered)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Joe Satriani"], AlbumArtUrl = imgUrl }, - new Album { Title = "Switched-On Bach", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Wendy Carlos"], AlbumArtUrl = imgUrl }, - new Album { Title = "Symphony", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "Szymanowski: Piano Works, Vol. 1", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Martin Roscoe"], AlbumArtUrl = imgUrl }, - new Album { Title = "Tchaikovsky: The Nutcracker", Genre = genres["Classical"], Price = 8.99M, Artist = artists["London Symphony Orchestra"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ted Nugent", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Ted Nugent"], AlbumArtUrl = imgUrl }, - new Album { Title = "Teflon Don", Genre = genres["Rap"], Price = 8.99M, Artist = artists["Rick Ross"], AlbumArtUrl = imgUrl }, - new Album { Title = "Tell Another Joke at the Ol' Choppin' Block", Genre = genres["Indie"], Price = 8.99M, Artist = artists["Danielson Famile"], AlbumArtUrl = imgUrl }, - new Album { Title = "Temple of the Dog", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Temple of the Dog"], AlbumArtUrl = imgUrl }, - new Album { Title = "Ten", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pearl Jam"], AlbumArtUrl = imgUrl }, - new Album { Title = "Texas Flood", Genre = genres["Blues"], Price = 8.99M, Artist = artists["Stevie Ray Vaughan"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Battle Rages On", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Beast Live", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Paul D'Ianno"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Best Of 1980-1990", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Best of 1990–2000", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Best of Beethoven", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Nicolaus Esterhazy Sinfonia"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Best Of Billy Cobham", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Billy Cobham"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Best of Ed Motta", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Ed Motta"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Best Of Van Halen, Vol. I", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Van Halen"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Bridge", Genre = genres["R&B"], Price = 8.99M, Artist = artists["Melanie Fiona"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Cage", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Tygers of Pan Tang"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Chicago Transit Authority", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Chicago "], AlbumArtUrl = imgUrl }, - new Album { Title = "The Chronic", Genre = genres["Rap"], Price = 8.99M, Artist = artists["Dr. Dre"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Colour And The Shape", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Foo Fighters"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Crane Wife", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["The Decemberists"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Cream Of Clapton", Genre = genres["Blues"], Price = 8.99M, Artist = artists["Eric Clapton"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Cure", Genre = genres["Pop"], Price = 8.99M, Artist = artists["The Cure"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Dark Side Of The Moon", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pink Floyd"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Divine Conspiracy", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Epica"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Doors", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Doors"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Dream of the Blue Turtles", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Sting"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Essential Miles Davis [Disc 1]", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Miles Davis"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Essential Miles Davis [Disc 2]", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Miles Davis"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Final Concerts (Disc 2)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deep Purple"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Final Frontier", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Head and the Heart", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Head and the Heart"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Joshua Tree", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Last Night of the Proms", Genre = genres["Classical"], Price = 8.99M, Artist = artists["BBC Concert Orchestra"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Lumineers", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Lumineers"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Number of The Beast", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Number of The Beast", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Police Greatest Hits", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Police"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Song Remains The Same (Disc 1)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Song Remains The Same (Disc 2)", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Southern Harmony and Musical Companion", Genre = genres["Blues"], Price = 8.99M, Artist = artists["The Black Crowes"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Spade", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Butch Walker & The Black Widows"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Stone Roses", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Stone Roses"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Suburbs", Genre = genres["Indie"], Price = 8.99M, Artist = artists["Arcade Fire"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Three Tenors Disc1/Disc2", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Carreras, Pavarotti, Domingo"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Trees They Grow So High", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "The Wall", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pink Floyd"], AlbumArtUrl = imgUrl }, - new Album { Title = "The X Factor", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Them Crooked Vultures", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Them Crooked Vultures"], AlbumArtUrl = imgUrl }, - new Album { Title = "This Is Happening", Genre = genres["Rock"], Price = 8.99M, Artist = artists["LCD Soundsystem"], AlbumArtUrl = imgUrl }, - new Album { Title = "Thunder, Lightning, Strike", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Go! Team"], AlbumArtUrl = imgUrl }, - new Album { Title = "Time to Say Goodbye", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sarah Brightman"], AlbumArtUrl = imgUrl }, - new Album { Title = "Time, Love & Tenderness", Genre = genres["Pop"], Price = 8.99M, Artist = artists["Michael Bolton"], AlbumArtUrl = imgUrl }, - new Album { Title = "Tomorrow Starts Today", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Mobile"], AlbumArtUrl = imgUrl }, - new Album { Title = "Tribute", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Ozzy Osbourne"], AlbumArtUrl = imgUrl }, - new Album { Title = "Tuesday Night Music Club", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Sheryl Crow"], AlbumArtUrl = imgUrl }, - new Album { Title = "Umoja", Genre = genres["Rock"], Price = 8.99M, Artist = artists["BLØF"], AlbumArtUrl = imgUrl }, - new Album { Title = "Under the Pink", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Tori Amos"], AlbumArtUrl = imgUrl }, - new Album { Title = "Undertow", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Tool"], AlbumArtUrl = imgUrl }, - new Album { Title = "Un-Led-Ed", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Dread Zeppelin"], AlbumArtUrl = imgUrl }, - new Album { Title = "Unplugged [Live]", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Kiss"], AlbumArtUrl = imgUrl }, - new Album { Title = "Unplugged", Genre = genres["Blues"], Price = 8.99M, Artist = artists["Eric Clapton"], AlbumArtUrl = imgUrl }, - new Album { Title = "Unplugged", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Eric Clapton"], AlbumArtUrl = imgUrl }, - new Album { Title = "Untrue", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Burial"], AlbumArtUrl = imgUrl }, - new Album { Title = "Use Your Illusion I", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Guns N' Roses"], AlbumArtUrl = imgUrl }, - new Album { Title = "Use Your Illusion II", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Guns N' Roses"], AlbumArtUrl = imgUrl }, - new Album { Title = "Use Your Illusion II", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Guns N' Roses"], AlbumArtUrl = imgUrl }, - new Album { Title = "Van Halen III", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Van Halen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Van Halen", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Van Halen"], AlbumArtUrl = imgUrl }, - new Album { Title = "Version 2.0", Genre = genres["Alternative"], Price = 8.99M, Artist = artists["Garbage"], AlbumArtUrl = imgUrl }, - new Album { Title = "Vinicius De Moraes", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Vinícius De Moraes"], AlbumArtUrl = imgUrl }, - new Album { Title = "Virtual XI", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Iron Maiden"], AlbumArtUrl = imgUrl }, - new Album { Title = "Voodoo Lounge", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Rolling Stones"], AlbumArtUrl = imgUrl }, - new Album { Title = "Vozes do MPB", Genre = genres["Latin"], Price = 8.99M, Artist = artists["Various Artists"], AlbumArtUrl = imgUrl }, - new Album { Title = "Vs.", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pearl Jam"], AlbumArtUrl = imgUrl }, - new Album { Title = "Wagner: Favourite Overtures", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Sir Georg Solti & Wiener Philharmoniker"], AlbumArtUrl = imgUrl }, - new Album { Title = "Walking Into Clarksdale", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Page & Plant"], AlbumArtUrl = imgUrl }, - new Album { Title = "Wapi Yo", Genre = genres["World"], Price = 8.99M, Artist = artists["Lokua Kanza"], AlbumArtUrl = imgUrl }, - new Album { Title = "War", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "Warner 25 Anos", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Antônio Carlos Jobim"], AlbumArtUrl = imgUrl }, - new Album { Title = "Wasteland R&Btheque", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Raunchy"], AlbumArtUrl = imgUrl }, - new Album { Title = "Watermark", Genre = genres["Electronic"], Price = 8.99M, Artist = artists["Enya"], AlbumArtUrl = imgUrl }, - new Album { Title = "We Were Exploding Anyway", Genre = genres["Rock"], Price = 8.99M, Artist = artists["65daysofstatic"], AlbumArtUrl = imgUrl }, - new Album { Title = "Weill: The Seven Deadly Sins", Genre = genres["Classical"], Price = 8.99M, Artist = artists["Orchestre de l'Opéra de Lyon"], AlbumArtUrl = imgUrl }, - new Album { Title = "White Pony", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Deftones"], AlbumArtUrl = imgUrl }, - new Album { Title = "Who's Next", Genre = genres["Rock"], Price = 8.99M, Artist = artists["The Who"], AlbumArtUrl = imgUrl }, - new Album { Title = "Wish You Were Here", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Pink Floyd"], AlbumArtUrl = imgUrl }, - new Album { Title = "With Oden on Our Side", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Amon Amarth"], AlbumArtUrl = imgUrl }, - new Album { Title = "Worlds", Genre = genres["Jazz"], Price = 8.99M, Artist = artists["Aaron Goldberg"], AlbumArtUrl = imgUrl }, - new Album { Title = "Worship Music", Genre = genres["Metal"], Price = 8.99M, Artist = artists["Anthrax"], AlbumArtUrl = imgUrl }, - new Album { Title = "X&Y", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Coldplay"], AlbumArtUrl = imgUrl }, - new Album { Title = "Xinti", Genre = genres["World"], Price = 8.99M, Artist = artists["Sara Tavares"], AlbumArtUrl = imgUrl }, - new Album { Title = "Yano", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Yano"], AlbumArtUrl = imgUrl }, - new Album { Title = "Yesterday Once More Disc 1/Disc 2", Genre = genres["Pop"], Price = 8.99M, Artist = artists["The Carpenters"], AlbumArtUrl = imgUrl }, - new Album { Title = "Zooropa", Genre = genres["Rock"], Price = 8.99M, Artist = artists["U2"], AlbumArtUrl = imgUrl }, - new Album { Title = "Zoso", Genre = genres["Rock"], Price = 8.99M, Artist = artists["Led Zeppelin"], AlbumArtUrl = imgUrl }, - }; - - foreach (var album in albums) - { - album.ArtistId = album.Artist.ArtistId; - album.GenreId = album.Genre.GenreId; - } - - return albums; - } - - private static Dictionary artists; - public static Dictionary Artists - { - get - { - if (artists == null) - { - var artistsList = new Artist[] - { - new Artist { Name = "65daysofstatic" }, - new Artist { Name = "Aaron Goldberg" }, - new Artist { Name = "Above & Beyond" }, - new Artist { Name = "Above the Fold" }, - new Artist { Name = "AC/DC" }, - new Artist { Name = "Accept" }, - new Artist { Name = "Adicts" }, - new Artist { Name = "Adrian Leaper & Doreen de Feis" }, - new Artist { Name = "Aerosmith" }, - new Artist { Name = "Aisha Duo" }, - new Artist { Name = "Al di Meola" }, - new Artist { Name = "Alabama Shakes" }, - new Artist { Name = "Alanis Morissette" }, - new Artist { Name = "Alberto Turco & Nova Schola Gregoriana" }, - new Artist { Name = "Alice in Chains" }, - new Artist { Name = "Alison Krauss" }, - new Artist { Name = "Amon Amarth" }, - new Artist { Name = "Amon Tobin" }, - new Artist { Name = "Amr Diab" }, - new Artist { Name = "Amy Winehouse" }, - new Artist { Name = "Anita Ward" }, - new Artist { Name = "Anthrax" }, - new Artist { Name = "Antônio Carlos Jobim" }, - new Artist { Name = "Apocalyptica" }, - new Artist { Name = "Aqua" }, - new Artist { Name = "Armand Van Helden" }, - new Artist { Name = "Arcade Fire" }, - new Artist { Name = "Audioslave" }, - new Artist { Name = "Bad Religion" }, - new Artist { Name = "Barenaked Ladies" }, - new Artist { Name = "BBC Concert Orchestra" }, - new Artist { Name = "Bee Gees" }, - new Artist { Name = "Before the Dawn" }, - new Artist { Name = "Berliner Philharmoniker" }, - new Artist { Name = "Billy Cobham" }, - new Artist { Name = "Black Label Society" }, - new Artist { Name = "Black Sabbath" }, - new Artist { Name = "BLØF" }, - new Artist { Name = "Blues Traveler" }, - new Artist { Name = "Boston Symphony Orchestra & Seiji Ozawa" }, - new Artist { Name = "Britten Sinfonia, Ivor Bolton & Lesley Garrett" }, - new Artist { Name = "Bruce Dickinson" }, - new Artist { Name = "Buddy Guy" }, - new Artist { Name = "Burial" }, - new Artist { Name = "Butch Walker & The Black Widows" }, - new Artist { Name = "Caetano Veloso" }, - new Artist { Name = "Cake" }, - new Artist { Name = "Calexico" }, - new Artist { Name = "Carly Rae Jepsen" }, - new Artist { Name = "Carreras, Pavarotti, Domingo" }, - new Artist { Name = "Cássia Eller" }, - new Artist { Name = "Cayouche" }, - new Artist { Name = "Chic" }, - new Artist { Name = "Chicago " }, - new Artist { Name = "Chicago Symphony Orchestra & Fritz Reiner" }, - new Artist { Name = "Chico Buarque" }, - new Artist { Name = "Chico Science & Nação Zumbi" }, - new Artist { Name = "Choir Of Westminster Abbey & Simon Preston" }, - new Artist { Name = "Chris Cornell" }, - new Artist { Name = "Christopher O'Riley" }, - new Artist { Name = "Cidade Negra" }, - new Artist { Name = "Cláudio Zoli" }, - new Artist { Name = "Coldplay" }, - new Artist { Name = "Creedence Clearwater Revival" }, - new Artist { Name = "Crosby, Stills, Nash, and Young" }, - new Artist { Name = "Daft Punk" }, - new Artist { Name = "Danielson Famile" }, - new Artist { Name = "David Bowie" }, - new Artist { Name = "David Coverdale" }, - new Artist { Name = "David Guetta" }, - new Artist { Name = "deadmau5" }, - new Artist { Name = "Deep Purple" }, - new Artist { Name = "Def Leppard" }, - new Artist { Name = "Deftones" }, - new Artist { Name = "Dennis Chambers" }, - new Artist { Name = "Deva Premal" }, - new Artist { Name = "Dio" }, - new Artist { Name = "Djavan" }, - new Artist { Name = "Dolly Parton" }, - new Artist { Name = "Donna Summer" }, - new Artist { Name = "Dr. Dre" }, - new Artist { Name = "Dread Zeppelin" }, - new Artist { Name = "Dream Theater" }, - new Artist { Name = "Duck Sauce" }, - new Artist { Name = "Earl Scruggs" }, - new Artist { Name = "Ed Motta" }, - new Artist { Name = "Edo de Waart & San Francisco Symphony" }, - new Artist { Name = "Elis Regina" }, - new Artist { Name = "Eminem" }, - new Artist { Name = "English Concert & Trevor Pinnock" }, - new Artist { Name = "Enya" }, - new Artist { Name = "Epica" }, - new Artist { Name = "Eric B. and Rakim" }, - new Artist { Name = "Eric Clapton" }, - new Artist { Name = "Eugene Ormandy" }, - new Artist { Name = "Faith No More" }, - new Artist { Name = "Falamansa" }, - new Artist { Name = "Filter" }, - new Artist { Name = "Foo Fighters" }, - new Artist { Name = "Four Tet" }, - new Artist { Name = "Frank Zappa & Captain Beefheart" }, - new Artist { Name = "Fretwork" }, - new Artist { Name = "Funk Como Le Gusta" }, - new Artist { Name = "Garbage" }, - new Artist { Name = "Gerald Moore" }, - new Artist { Name = "Gilberto Gil" }, - new Artist { Name = "Godsmack" }, - new Artist { Name = "Gonzaguinha" }, - new Artist { Name = "Göteborgs Symfoniker & Neeme Järvi" }, - new Artist { Name = "Guns N' Roses" }, - new Artist { Name = "Gustav Mahler" }, - new Artist { Name = "In This Moment" }, - new Artist { Name = "Incognito" }, - new Artist { Name = "INXS" }, - new Artist { Name = "Iron Maiden" }, - new Artist { Name = "Jagjit Singh" }, - new Artist { Name = "James Levine" }, - new Artist { Name = "Jamiroquai" }, - new Artist { Name = "Jimi Hendrix" }, - new Artist { Name = "Jimmy Buffett" }, - new Artist { Name = "Jimmy Smith" }, - new Artist { Name = "Joe Satriani" }, - new Artist { Name = "John Digweed" }, - new Artist { Name = "John Mayer" }, - new Artist { Name = "Jorge Ben" }, - new Artist { Name = "Jota Quest" }, - new Artist { Name = "Journey" }, - new Artist { Name = "Judas Priest" }, - new Artist { Name = "Julian Bream" }, - new Artist { Name = "Justice" }, - new Artist { Name = "Orchestre de l'Opéra de Lyon" }, - new Artist { Name = "King Crimson" }, - new Artist { Name = "Kiss" }, - new Artist { Name = "LCD Soundsystem" }, - new Artist { Name = "Le Tigre" }, - new Artist { Name = "Led Zeppelin" }, - new Artist { Name = "Legião Urbana" }, - new Artist { Name = "Lenny Kravitz" }, - new Artist { Name = "Les Arts Florissants & William Christie" }, - new Artist { Name = "Limp Bizkit" }, - new Artist { Name = "Linkin Park" }, - new Artist { Name = "Live" }, - new Artist { Name = "Lokua Kanza" }, - new Artist { Name = "London Symphony Orchestra" }, - new Artist { Name = "Los Tigres del Norte" }, - new Artist { Name = "Luciana Souza/Romero Lubambo" }, - new Artist { Name = "Lulu Santos" }, - new Artist { Name = "Lura" }, - new Artist { Name = "Marcos Valle" }, - new Artist { Name = "Marillion" }, - new Artist { Name = "Marisa Monte" }, - new Artist { Name = "Mark Knopfler" }, - new Artist { Name = "Martin Roscoe" }, - new Artist { Name = "Massive Attack" }, - new Artist { Name = "Maurizio Pollini" }, - new Artist { Name = "Megadeth" }, - new Artist { Name = "Mela Tenenbaum, Pro Musica Prague & Richard Kapp" }, - new Artist { Name = "Melanie Fiona" }, - new Artist { Name = "Men At Work" }, - new Artist { Name = "Metallica" }, - new Artist { Name = "M-Flo" }, - new Artist { Name = "Michael Bolton" }, - new Artist { Name = "Michael Tilson Thomas" }, - new Artist { Name = "Miles Davis" }, - new Artist { Name = "Milton Nascimento" }, - new Artist { Name = "Mobile" }, - new Artist { Name = "Modest Mouse" }, - new Artist { Name = "Mötley Crüe" }, - new Artist { Name = "Motörhead" }, - new Artist { Name = "Mumford & Sons" }, - new Artist { Name = "Munkle" }, - new Artist { Name = "Nash Ensemble" }, - new Artist { Name = "Neil Young" }, - new Artist { Name = "New York Dolls" }, - new Artist { Name = "Nick Cave and the Bad Seeds" }, - new Artist { Name = "Nicolaus Esterhazy Sinfonia" }, - new Artist { Name = "Nine Inch Nails" }, - new Artist { Name = "Nirvana" }, - new Artist { Name = "Norah Jones" }, - new Artist { Name = "Nujabes" }, - new Artist { Name = "O Terço" }, - new Artist { Name = "Oasis" }, - new Artist { Name = "Olodum" }, - new Artist { Name = "Opeth" }, - new Artist { Name = "Orchestra of The Age of Enlightenment" }, - new Artist { Name = "Os Paralamas Do Sucesso" }, - new Artist { Name = "Ozzy Osbourne" }, - new Artist { Name = "Paddy Casey" }, - new Artist { Name = "Page & Plant" }, - new Artist { Name = "Papa Wemba" }, - new Artist { Name = "Paul D'Ianno" }, - new Artist { Name = "Paul Oakenfold" }, - new Artist { Name = "Paul Van Dyk" }, - new Artist { Name = "Pearl Jam" }, - new Artist { Name = "Pet Shop Boys" }, - new Artist { Name = "Pink Floyd" }, - new Artist { Name = "Plug" }, - new Artist { Name = "Porcupine Tree" }, - new Artist { Name = "Portishead" }, - new Artist { Name = "Prince" }, - new Artist { Name = "Projected" }, - new Artist { Name = "PSY" }, - new Artist { Name = "Public Enemy" }, - new Artist { Name = "Queen" }, - new Artist { Name = "Queensrÿche" }, - new Artist { Name = "R.E.M." }, - new Artist { Name = "Radiohead" }, - new Artist { Name = "Rancid" }, - new Artist { Name = "Raul Seixas" }, - new Artist { Name = "Raunchy" }, - new Artist { Name = "Red Hot Chili Peppers" }, - new Artist { Name = "Rick Ross" }, - new Artist { Name = "Robert James" }, - new Artist { Name = "London Classical Players" }, - new Artist { Name = "Royal Philharmonic Orchestra" }, - new Artist { Name = "Run DMC" }, - new Artist { Name = "Rush" }, - new Artist { Name = "Santana" }, - new Artist { Name = "Sara Tavares" }, - new Artist { Name = "Sarah Brightman" }, - new Artist { Name = "Sasha" }, - new Artist { Name = "Scholars Baroque Ensemble" }, - new Artist { Name = "Scorpions" }, - new Artist { Name = "Sergei Prokofiev & Yuri Temirkanov" }, - new Artist { Name = "Sheryl Crow" }, - new Artist { Name = "Sir Georg Solti & Wiener Philharmoniker" }, - new Artist { Name = "Skank" }, - new Artist { Name = "Skrillex" }, - new Artist { Name = "Slash" }, - new Artist { Name = "Slayer" }, - new Artist { Name = "Soul-Junk" }, - new Artist { Name = "Soundgarden" }, - new Artist { Name = "Spyro Gyra" }, - new Artist { Name = "Stevie Ray Vaughan & Double Trouble" }, - new Artist { Name = "Stevie Ray Vaughan" }, - new Artist { Name = "Sting" }, - new Artist { Name = "Stone Temple Pilots" }, - new Artist { Name = "Styx" }, - new Artist { Name = "Sufjan Stevens" }, - new Artist { Name = "Supreme Beings of Leisure" }, - new Artist { Name = "System Of A Down" }, - new Artist { Name = "T&N" }, - new Artist { Name = "Talking Heads" }, - new Artist { Name = "Tears For Fears" }, - new Artist { Name = "Ted Nugent" }, - new Artist { Name = "Temple of the Dog" }, - new Artist { Name = "Terry Bozzio, Tony Levin & Steve Stevens" }, - new Artist { Name = "The 12 Cellists of The Berlin Philharmonic" }, - new Artist { Name = "The Axis of Awesome" }, - new Artist { Name = "The Beatles" }, - new Artist { Name = "The Black Crowes" }, - new Artist { Name = "The Black Keys" }, - new Artist { Name = "The Carpenters" }, - new Artist { Name = "The Cat Empire" }, - new Artist { Name = "The Cult" }, - new Artist { Name = "The Cure" }, - new Artist { Name = "The Decemberists" }, - new Artist { Name = "The Doors" }, - new Artist { Name = "The Eagles of Death Metal" }, - new Artist { Name = "The Go! Team" }, - new Artist { Name = "The Head and the Heart" }, - new Artist { Name = "The Jezabels" }, - new Artist { Name = "The King's Singers" }, - new Artist { Name = "The Lumineers" }, - new Artist { Name = "The Offspring" }, - new Artist { Name = "The Police" }, - new Artist { Name = "The Posies" }, - new Artist { Name = "The Prodigy" }, - new Artist { Name = "The Rolling Stones" }, - new Artist { Name = "The Rubberbandits" }, - new Artist { Name = "The Smashing Pumpkins" }, - new Artist { Name = "The Stone Roses" }, - new Artist { Name = "The Who" }, - new Artist { Name = "Them Crooked Vultures" }, - new Artist { Name = "TheStart" }, - new Artist { Name = "Thievery Corporation" }, - new Artist { Name = "Tiësto" }, - new Artist { Name = "Tim Maia" }, - new Artist { Name = "Ton Koopman" }, - new Artist { Name = "Tool" }, - new Artist { Name = "Tori Amos" }, - new Artist { Name = "Trampled By Turtles" }, - new Artist { Name = "Trans-Siberian Orchestra" }, - new Artist { Name = "Tygers of Pan Tang" }, - new Artist { Name = "U2" }, - new Artist { Name = "UB40" }, - new Artist { Name = "Uh Huh Her " }, - new Artist { Name = "Van Halen" }, - new Artist { Name = "Various Artists" }, - new Artist { Name = "Velvet Revolver" }, - new Artist { Name = "Venus Hum" }, - new Artist { Name = "Vicente Fernandez" }, - new Artist { Name = "Vinícius De Moraes" }, - new Artist { Name = "Weezer" }, - new Artist { Name = "Weird Al" }, - new Artist { Name = "Wendy Carlos" }, - new Artist { Name = "Wilhelm Kempff" }, - new Artist { Name = "Yano" }, - new Artist { Name = "Yehudi Menuhin" }, - new Artist { Name = "Yes" }, - new Artist { Name = "Yo-Yo Ma" }, - new Artist { Name = "Zeca Pagodinho" }, - new Artist { Name = "אריק אינשטיין"} - }; - - // TODO [EF] Swap to store generated keys when available - int artistId = 1; - artists = new Dictionary(); - foreach (Artist artist in artistsList) - { - artist.ArtistId = artistId++; - artists.Add(artist.Name, artist); - } - } - - return artists; - } - } - - private static Dictionary genres; - public static Dictionary Genres - { - get - { - if (genres == null) - { - var genresList = new Genre[] - { - new Genre { Name = "Pop" }, - new Genre { Name = "Rock" }, - new Genre { Name = "Jazz" }, - new Genre { Name = "Metal" }, - new Genre { Name = "Electronic" }, - new Genre { Name = "Blues" }, - new Genre { Name = "Latin" }, - new Genre { Name = "Rap" }, - new Genre { Name = "Classical" }, - new Genre { Name = "Alternative" }, - new Genre { Name = "Country" }, - new Genre { Name = "R&B" }, - new Genre { Name = "Indie" }, - new Genre { Name = "Punk" }, - new Genre { Name = "World" } - }; - - genres = new Dictionary(); - // TODO [EF] Swap to store generated keys when available - int genreId = 1; - foreach (Genre genre in genresList) - { - genre.GenreId = genreId++; - - // TODO [EF] Remove when null values are supported by update pipeline - genre.Description = genre.Name + " is great music (if you like it)."; - - genres.Add(genre.Name, genre); - } - } - - return genres; - } - } - } -} diff --git a/samples/react/MusicStore/Apis/Models/ShoppingCart.cs b/samples/react/MusicStore/Apis/Models/ShoppingCart.cs deleted file mode 100644 index 1d2465ab..00000000 --- a/samples/react/MusicStore/Apis/Models/ShoppingCart.cs +++ /dev/null @@ -1,207 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; - -namespace MusicStore.Models -{ - public partial class ShoppingCart - { - MusicStoreContext _db; - string ShoppingCartId { get; set; } - - public ShoppingCart(MusicStoreContext db) - { - _db = db; - } - - public static ShoppingCart GetCart(MusicStoreContext db, HttpContext context) - { - var cart = new ShoppingCart(db); - cart.ShoppingCartId = cart.GetCartId(context); - return cart; - } - - public void AddToCart(Album album) - { - // Get the matching cart and album instances - var cartItem = _db.CartItems.SingleOrDefault( - c => c.CartId == ShoppingCartId - && c.AlbumId == album.AlbumId); - - if (cartItem == null) - { - // TODO [EF] Swap to store generated key once we support identity pattern - var nextCartItemId = _db.CartItems.Any() - ? _db.CartItems.Max(c => c.CartItemId) + 1 - : 1; - - // Create a new cart item if no cart item exists - cartItem = new CartItem - { - CartItemId = nextCartItemId, - AlbumId = album.AlbumId, - CartId = ShoppingCartId, - Count = 1, - DateCreated = DateTime.Now - }; - - _db.CartItems.Add(cartItem); - } - else - { - // If the item does exist in the cart, then add one to the quantity - cartItem.Count++; - - // TODO [EF] Remove this line once change detection is available - _db.Update(cartItem); - } - } - - public int RemoveFromCart(int id) - { - // Get the cart - var cartItem = _db.CartItems.Single( - cart => cart.CartId == ShoppingCartId - && cart.CartItemId == id); - - int itemCount = 0; - - if (cartItem != null) - { - if (cartItem.Count > 1) - { - cartItem.Count--; - - // TODO [EF] Remove this line once change detection is available - _db.Update(cartItem); - - itemCount = cartItem.Count; - } - else - { - _db.CartItems.Remove(cartItem); - } - } - - return itemCount; - } - - public void EmptyCart() - { - var cartItems = _db.CartItems.Where(cart => cart.CartId == ShoppingCartId); - - foreach (var cartItem in cartItems) - { - _db.Remove(cartItem); - } - } - - public List GetCartItems() - { - var cartItems = _db.CartItems.Where(cart => cart.CartId == ShoppingCartId).ToList(); - //TODO: Auto population of the related album data not available until EF feature is lighted up. - foreach (var cartItem in cartItems) - { - cartItem.Album = _db.Albums.Single(a => a.AlbumId == cartItem.AlbumId); - } - - return cartItems; - } - - public int GetCount() - { - // Get the count of each item in the cart and sum them up - int? count = (from cartItems in _db.CartItems - where cartItems.CartId == ShoppingCartId - select (int?)cartItems.Count).Sum(); - - // Return 0 if all entries are null - return count ?? 0; - } - - public decimal GetTotal() - { - // Multiply album price by count of that album to get - // the current price for each of those albums in the cart - // sum all album price totals to get the cart total - - // TODO Collapse to a single query once EF supports querying related data - decimal total = 0; - foreach (var item in _db.CartItems.Where(c => c.CartId == ShoppingCartId)) - { - var album = _db.Albums.Single(a => a.AlbumId == item.AlbumId); - total += item.Count * album.Price; - } - - return total; - } - - public int CreateOrder(Order order) - { - decimal orderTotal = 0; - - var cartItems = GetCartItems(); - - // TODO [EF] Swap to store generated identity key when supported - var nextId = _db.OrderDetails.Any() - ? _db.OrderDetails.Max(o => o.OrderDetailId) + 1 - : 1; - - // Iterate over the items in the cart, adding the order details for each - foreach (var item in cartItems) - { - //var album = _db.Albums.Find(item.AlbumId); - var album = _db.Albums.Single(a => a.AlbumId == item.AlbumId); - - var orderDetail = new OrderDetail - { - OrderDetailId = nextId, - AlbumId = item.AlbumId, - OrderId = order.OrderId, - UnitPrice = album.Price, - Quantity = item.Count, - }; - - // Set the order total of the shopping cart - orderTotal += (item.Count * album.Price); - - _db.OrderDetails.Add(orderDetail); - - nextId++; - } - - // Set the order's total to the orderTotal count - order.Total = orderTotal; - - // Empty the shopping cart - EmptyCart(); - - // Return the OrderId as the confirmation number - return order.OrderId; - } - - // We're using HttpContextBase to allow access to cookies. - public string GetCartId(HttpContext context) - { - var sessionCookie = context.Request.Cookies["Session"]; - string cartId = null; - - if (string.IsNullOrWhiteSpace(sessionCookie)) - { - //A GUID to hold the cartId. - cartId = Guid.NewGuid().ToString(); - - // Send cart Id as a cookie to the client. - context.Response.Cookies.Append("Session", cartId); - } - else - { - cartId = sessionCookie; - } - - return cartId; - } - } -} diff --git a/samples/react/MusicStore/Controllers/HomeController.cs b/samples/react/MusicStore/Controllers/HomeController.cs deleted file mode 100755 index 1048e083..00000000 --- a/samples/react/MusicStore/Controllers/HomeController.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace MusicStore.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - } -} diff --git a/samples/react/MusicStore/Infrastructure/NoCacheAttribute.cs b/samples/react/MusicStore/Infrastructure/NoCacheAttribute.cs deleted file mode 100644 index 856023a8..00000000 --- a/samples/react/MusicStore/Infrastructure/NoCacheAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using System; -using Microsoft.AspNetCore.Mvc.Filters; - -namespace MusicStore.Infrastructure -{ - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] - public sealed class NoCacheAttribute : ActionFilterAttribute - { - public override void OnResultExecuting(ResultExecutingContext context) - { - context.HttpContext.Response.Headers["Cache-Control"] = "no-cache, no-store, max-age=0"; - context.HttpContext.Response.Headers["Pragma"] = "no-cache"; - context.HttpContext.Response.Headers["Expires"] = "-1"; - - base.OnResultExecuting(context); - } - } -} diff --git a/samples/react/MusicStore/Infrastructure/PagedList.cs b/samples/react/MusicStore/Infrastructure/PagedList.cs deleted file mode 100644 index b2cb2c57..00000000 --- a/samples/react/MusicStore/Infrastructure/PagedList.cs +++ /dev/null @@ -1,150 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; - -namespace MusicStore.Infrastructure -{ - public interface IPagedList - { - IEnumerable Data { get; } - - int Page { get; } - - int PageSize { get; } - - int TotalCount { get; } - } - - internal class PagedList : IPagedList - { - public PagedList(IEnumerable data, int page, int pageSize, int totalCount) - { - Data = data; - Page = page; - PageSize = pageSize; - TotalCount = totalCount; - } - - public IEnumerable Data { get; private set; } - - public int Page { get; private set; } - - public int PageSize { get; private set; } - - public int TotalCount { get; private set; } - } - - public static class PagedListExtensions - { - public static IPagedList ToPagedList(this IQueryable query, int page, int pageSize) - { - if (query == null) - { - throw new ArgumentNullException("query"); - } - - var pagingConfig = new PagingConfig(page, pageSize); - var skipCount = ValidatePagePropertiesAndGetSkipCount(pagingConfig); - - var data = query - .Skip(skipCount) - .Take(pagingConfig.PageSize) - .ToList(); - - if (skipCount > 0 && data.Count == 0) - { - // Requested page has no records, just return the first page - pagingConfig.Page = 1; - data = query - .Take(pagingConfig.PageSize) - .ToList(); - } - - return new PagedList(data, pagingConfig.Page, pagingConfig.PageSize, query.Count()); - } - - public static Task> ToPagedListAsync(this IQueryable query, int page, int pageSize, string sortExpression, Expression> defaultSortExpression, SortDirection defaultSortDirection = SortDirection.Ascending) - where TModel : class - { - return ToPagedListAsync(query, page, pageSize, sortExpression, defaultSortExpression, defaultSortDirection, null); - } - - public static async Task> ToPagedListAsync(this IQueryable query, int page, int pageSize, string sortExpression, Expression> defaultSortExpression, SortDirection defaultSortDirection, Func selector) - where TModel : class - where TResult : class - { - if (query == null) - { - throw new ArgumentNullException("query"); - } - - var pagingConfig = new PagingConfig(page, pageSize); - var skipCount = ValidatePagePropertiesAndGetSkipCount(pagingConfig); - var dataQuery = query; - - if (defaultSortExpression != null) - { - dataQuery = dataQuery - .SortBy(sortExpression, defaultSortExpression); - } - - var data = await dataQuery - .Skip(skipCount) - .Take(pagingConfig.PageSize) - .ToListAsync(); - - if (skipCount > 0 && data.Count == 0) - { - // Requested page has no records, just return the first page - pagingConfig.Page = 1; - data = await dataQuery - .Take(pagingConfig.PageSize) - .ToListAsync(); - } - - var count = await query.CountAsync(); - - var resultData = selector != null - ? data.Select(selector) - : data.Cast(); - - return new PagedList(resultData, pagingConfig.Page, pagingConfig.PageSize, count); - } - - private static int ValidatePagePropertiesAndGetSkipCount(PagingConfig pagingConfig) - { - if (pagingConfig.Page < 1) - { - pagingConfig.Page = 1; - } - - if (pagingConfig.PageSize < 10) - { - pagingConfig.PageSize = 10; - } - - if (pagingConfig.PageSize > 100) - { - pagingConfig.PageSize = 100; - } - - return pagingConfig.PageSize * (pagingConfig.Page - 1); - } - - internal class PagingConfig - { - public PagingConfig(int page, int pageSize) - { - Page = page; - PageSize = pageSize; - } - - public int Page { get; set; } - - public int PageSize { get; set; } - } - } -} diff --git a/samples/react/MusicStore/Infrastructure/SortDirection.cs b/samples/react/MusicStore/Infrastructure/SortDirection.cs deleted file mode 100644 index 28f7e86c..00000000 --- a/samples/react/MusicStore/Infrastructure/SortDirection.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace MusicStore.Infrastructure -{ - public enum SortDirection - { - Ascending, - Descending - } -} diff --git a/samples/react/MusicStore/Infrastructure/SortExpression.cs b/samples/react/MusicStore/Infrastructure/SortExpression.cs deleted file mode 100644 index 88ba312c..00000000 --- a/samples/react/MusicStore/Infrastructure/SortExpression.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.ViewFeatures.Internal; - -namespace MusicStore.Infrastructure -{ - public static class SortExpression - { - private const string SORT_DIRECTION_DESC = " DESC"; - - public static IQueryable SortBy(this IQueryable query, string sortExpression, Expression> defaultSortExpression, SortDirection defaultSortDirection = SortDirection.Ascending) where TModel : class - { - return SortBy(query, sortExpression ?? Create(defaultSortExpression, defaultSortDirection)); - } - - public static string Create(Expression> expression, SortDirection sortDirection = SortDirection.Ascending) where TModel : class - { - var expressionText = ExpressionHelper.GetExpressionText(expression); - // TODO: Validate the expression depth, etc. - - var sortExpression = expressionText; - - if (sortDirection == SortDirection.Descending) - { - sortExpression += SORT_DIRECTION_DESC; - } - - return sortExpression; - } - - public static IQueryable SortBy(this IQueryable source, string sortExpression) where T : class - { - if (source == null) - { - throw new ArgumentNullException("source"); - } - - if (String.IsNullOrWhiteSpace(sortExpression)) - { - return source; - } - - sortExpression = sortExpression.Trim(); - var isDescending = false; - - // DataSource control passes the sort parameter with a direction - // if the direction is descending - if (sortExpression.EndsWith(SORT_DIRECTION_DESC, StringComparison.OrdinalIgnoreCase)) - { - isDescending = true; - var descIndex = sortExpression.Length - SORT_DIRECTION_DESC.Length; - sortExpression = sortExpression.Substring(0, descIndex).Trim(); - } - - if (string.IsNullOrEmpty(sortExpression)) - { - return source; - } - - ParameterExpression parameter = Expression.Parameter(source.ElementType, String.Empty); - - // Build up the property expression, e.g.: (m => m.Foo.Bar) - var sortExpressionParts = sortExpression.Split('.'); - Expression propertyExpression = parameter; - foreach (var property in sortExpressionParts) - { - propertyExpression = Expression.Property(propertyExpression, property); - } - - LambdaExpression lambda = Expression.Lambda(propertyExpression, parameter); - - var methodName = (isDescending) ? "OrderByDescending" : "OrderBy"; - - Expression methodCallExpression = Expression.Call( - typeof(Queryable), - methodName, - new[] { source.ElementType, propertyExpression.Type }, - source.Expression, - Expression.Quote(lambda)); - - return (IQueryable)source.Provider.CreateQuery(methodCallExpression); - } - } -} diff --git a/samples/react/MusicStore/MusicStore.xproj b/samples/react/MusicStore/MusicStore.xproj deleted file mode 100644 index 3096e79c..00000000 --- a/samples/react/MusicStore/MusicStore.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - true - - - - c870a92c-9e3f-4bf2-82b8-5758545a8b7c - MusicStore - ..\..\..\JavaScriptServices.sln\artifacts\obj\$(MSBuildProjectName) - ..\..\..\JavaScriptServices.sln\artifacts\bin\$(MSBuildProjectName)\ - - - 2.0 - 2018 - - - diff --git a/samples/react/MusicStore/Properties/launchSettings.json b/samples/react/MusicStore/Properties/launchSettings.json deleted file mode 100644 index e4360431..00000000 --- a/samples/react/MusicStore/Properties/launchSettings.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:51586/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "dotnet cli": { - "commandName": "Project", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/samples/react/MusicStore/ReactApp/boot-server.tsx b/samples/react/MusicStore/ReactApp/boot-server.tsx deleted file mode 100644 index 4bf5d6e3..00000000 --- a/samples/react/MusicStore/ReactApp/boot-server.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import * as React from 'react'; -import { Provider } from 'react-redux'; -import { renderToString } from 'react-dom/server'; -import { match, RouterContext } from 'react-router'; -import createMemoryHistory from 'history/lib/createMemoryHistory'; -import { routes } from './routes'; -import configureStore from './configureStore'; -React; - -export default function (params: any): Promise<{ html: string }> { - return new Promise<{ html: string, globals: { [key: string]: any } }>((resolve, reject) => { - // Match the incoming request against the list of client-side routes - match({ routes, location: params.location }, (error, redirectLocation, renderProps: any) => { - if (error) { - throw error; - } - - // Build an instance of the application - const history = createMemoryHistory(params.url); - const store = configureStore(history); - const app = ( - - - - ); - - // Perform an initial render that will cause any async tasks (e.g., data access) to begin - renderToString(app); - - // Once the tasks are done, we can perform the final render - // We also send the redux store state, so the client can continue execution where the server left off - params.domainTasks.then(() => { - resolve({ - html: renderToString(app), - globals: { initialReduxState: store.getState() } - }); - }, reject); // Also propagate any errors back into the host application - }); - }); -} diff --git a/samples/react/MusicStore/ReactApp/boot.tsx b/samples/react/MusicStore/ReactApp/boot.tsx deleted file mode 100644 index ad8f367e..00000000 --- a/samples/react/MusicStore/ReactApp/boot.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from 'react'; -import * as ReactDOM from 'react-dom'; -import { browserHistory, Router } from 'react-router'; -import { Provider } from 'react-redux'; -React; // Need this reference otherwise TypeScript doesn't think we're using it and ignores the import - -import './styles/styles.css'; -import 'bootstrap/dist/css/bootstrap.css'; -import configureStore from './configureStore'; -import { routes } from './routes'; -import { ApplicationState } from './store'; - -const initialState = (window as any).initialReduxState as ApplicationState; -const store = configureStore(browserHistory, initialState); - -ReactDOM.render( - - - , - document.getElementById('react-app') -); diff --git a/samples/react/MusicStore/ReactApp/components/NavMenu.tsx b/samples/react/MusicStore/ReactApp/components/NavMenu.tsx deleted file mode 100644 index 6e85da85..00000000 --- a/samples/react/MusicStore/ReactApp/components/NavMenu.tsx +++ /dev/null @@ -1,49 +0,0 @@ -import * as React from 'react'; -import { Navbar, Nav, NavItem, NavDropdown, MenuItem } from 'react-bootstrap'; -import { Link } from 'react-router'; -import { LinkContainer } from 'react-router-bootstrap'; -import { provide } from 'redux-typed'; -import { ApplicationState } from '../store'; -import * as GenreList from '../store/GenreList'; - -class NavMenu extends React.Component { - componentWillMount() { - this.props.requestGenresList(); - } - - public render() { - const genres = this.props.genres.slice(0, 5); - return ( - - - Music Store - - - - - - - ); - } -} - -// Selects which part of global state maps to this component, and defines a type for the resulting props -const provider = provide( - (state: ApplicationState) => state.genreList, - GenreList.actionCreators -); -type NavMenuProps = typeof provider.allProps; -export default provider.connect(NavMenu); diff --git a/samples/react/MusicStore/ReactApp/components/public/AlbumDetails.tsx b/samples/react/MusicStore/ReactApp/components/public/AlbumDetails.tsx deleted file mode 100644 index 6e6fab2e..00000000 --- a/samples/react/MusicStore/ReactApp/components/public/AlbumDetails.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import * as React from 'react'; -import { Link } from 'react-router'; -import { provide } from 'redux-typed'; -import { ApplicationState } from '../../store'; -import * as AlbumDetailsState from '../../store/AlbumDetails'; - -interface RouteParams { - albumId: string; -} - -class AlbumDetails extends React.Component { - componentWillMount() { - this.props.requestAlbumDetails(parseInt(this.props.params.albumId)); - } - - componentWillReceiveProps(nextProps: AlbumDetailsProps) { - this.props.requestAlbumDetails(parseInt(nextProps.params.albumId)); - } - - public render() { - if (this.props.album) { - const albumData = this.props.album; - return
-

{ albumData.Title }

- -

{

- -
-

- Genre: - { albumData.Genre.Name } -

-

- Artist: - { albumData.Artist.Name } -

-

- Price: - ${ albumData.Price.toFixed(2) } -

-

- Add to cart -

-
-
; - } else { - return

Loading...

; - } - } -} - -// Selects which part of global state maps to this component, and defines a type for the resulting props -const provider = provide( - (state: ApplicationState) => state.albumDetails, - AlbumDetailsState.actionCreators -).withExternalProps<{ params: RouteParams }>(); -type AlbumDetailsProps = typeof provider.allProps; -export default provider.connect(AlbumDetails); diff --git a/samples/react/MusicStore/ReactApp/components/public/AlbumTile.tsx b/samples/react/MusicStore/ReactApp/components/public/AlbumTile.tsx deleted file mode 100644 index 04b74d54..00000000 --- a/samples/react/MusicStore/ReactApp/components/public/AlbumTile.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import * as React from 'react'; -import { Link } from 'react-router'; -import { Album } from '../../store/FeaturedAlbums'; - -export class AlbumTile extends React.Component<{ album: Album, key?: any }, void> { - public render() { - const { album } = this.props; - return ( -
  • - - { -

    { album.Title }

    - -
  • - ); - } -} diff --git a/samples/react/MusicStore/ReactApp/components/public/GenreDetails.tsx b/samples/react/MusicStore/ReactApp/components/public/GenreDetails.tsx deleted file mode 100644 index 59dc50b5..00000000 --- a/samples/react/MusicStore/ReactApp/components/public/GenreDetails.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import * as React from 'react'; -import { Link } from 'react-router'; -import { provide } from 'redux-typed'; -import { ApplicationState } from '../../store'; -import * as GenreDetailsStore from '../../store/GenreDetails'; -import { AlbumTile } from './AlbumTile'; - -interface RouteParams { - genreId: string -} - -class GenreDetails extends React.Component { - componentWillMount() { - this.props.requestGenreDetails(parseInt(this.props.params.genreId)); - } - - componentWillReceiveProps(nextProps: GenreDetailsProps) { - this.props.requestGenreDetails(parseInt(nextProps.params.genreId)); - } - - public render() { - if (this.props.isLoaded) { - return
    -

    Albums

    - -
      - {this.props.albums.map(album => - - )} -
    -
    ; - } else { - return

    Loading...

    ; - } - } -} - -// Selects which part of global state maps to this component, and defines a type for the resulting props -const provider = provide( - (state: ApplicationState) => state.genreDetails, - GenreDetailsStore.actionCreators -).withExternalProps<{ params: RouteParams }>(); - -type GenreDetailsProps = typeof provider.allProps; -export default provider.connect(GenreDetails); diff --git a/samples/react/MusicStore/ReactApp/components/public/Genres.tsx b/samples/react/MusicStore/ReactApp/components/public/Genres.tsx deleted file mode 100644 index 1e03789b..00000000 --- a/samples/react/MusicStore/ReactApp/components/public/Genres.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import * as React from 'react'; -import { Link } from 'react-router'; -import { provide } from 'redux-typed'; -import { ApplicationState } from '../../store'; -import * as GenreList from '../../store/GenreList'; - -class Genres extends React.Component { - componentWillMount() { - this.props.requestGenresList(); - } - - public render() { - const { genres } = this.props; - return
    -

    Browse Genres

    - -

    Select from { this.props.isLoaded ? genres.length : '...' } genres:

    - -
      - {genres.map(genre => -
    • - - { genre.Name } - -
    • - )} -
    -
    ; - } -} - -// Selects which part of global state maps to this component, and defines a type for the resulting props -const provider = provide( - (state: ApplicationState) => state.genreList, - GenreList.actionCreators -); -type GenresProps = typeof provider.allProps; -export default provider.connect(Genres); diff --git a/samples/react/MusicStore/ReactApp/components/public/Home.tsx b/samples/react/MusicStore/ReactApp/components/public/Home.tsx deleted file mode 100644 index b0f03d80..00000000 --- a/samples/react/MusicStore/ReactApp/components/public/Home.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import * as React from 'react'; -import { Link } from 'react-router'; -import { provide } from 'redux-typed'; -import { ApplicationState } from '../../store'; -import { actionCreators } from '../../store/FeaturedAlbums'; -import { AlbumTile } from './AlbumTile'; - -class Home extends React.Component { - componentWillMount() { - this.props.requestFeaturedAlbums(); - } - - public render() { - return
    -
    -

    MVC Music Store

    - -
    -
      - {this.props.albums.map(album => - - )} -
    -
    ; - } -} - -// Selects which part of global state maps to this component, and defines a type for the resulting props -const provider = provide( - (state: ApplicationState) => state.featuredAlbums, - actionCreators -); -type HomeProps = typeof provider.allProps; -export default provider.connect(Home); diff --git a/samples/react/MusicStore/ReactApp/configureStore.ts b/samples/react/MusicStore/ReactApp/configureStore.ts deleted file mode 100644 index 9274c22b..00000000 --- a/samples/react/MusicStore/ReactApp/configureStore.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { createStore, applyMiddleware, compose, combineReducers } from 'redux'; -import * as thunkModule from 'redux-thunk'; -import { syncHistory, routeReducer } from 'react-router-redux'; -import * as Store from './store'; -import { typedToPlain } from 'redux-typed'; - -export default function configureStore(history: HistoryModule.History, initialState?: Store.ApplicationState) { - // Build middleware - const thunk = (thunkModule as any).default; // Workaround for TypeScript not importing thunk module as expected - const reduxRouterMiddleware = syncHistory(history); - const middlewares = [thunk, reduxRouterMiddleware, typedToPlain]; - const devToolsExtension = null;//(window as any).devToolsExtension; // If devTools is installed, connect to it - - const finalCreateStore = compose( - applyMiddleware(...middlewares), - devToolsExtension ? devToolsExtension() : f => f - )(createStore) - - // Combine all reducers - const allReducers = buildRootReducer(Store.reducers); - - const store = finalCreateStore(allReducers, initialState) as Redux.Store; - - // Required for replaying actions from devtools to work - reduxRouterMiddleware.listenForReplays(store); - - // Enable Webpack hot module replacement for reducers - if (module.hot) { - module.hot.accept('./store', () => { - const nextRootReducer = require('./store'); - store.replaceReducer(buildRootReducer(nextRootReducer.reducers)); - }); - } - - return store; -} - -function buildRootReducer(allReducers) { - return combineReducers(Object.assign({}, allReducers, { routing: routeReducer })) as Redux.Reducer; -} diff --git a/samples/react/MusicStore/ReactApp/routes.tsx b/samples/react/MusicStore/ReactApp/routes.tsx deleted file mode 100644 index bf4f5fca..00000000 --- a/samples/react/MusicStore/ReactApp/routes.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from 'react'; -import { Router, Route, HistoryBase } from 'react-router'; -import NavMenu from './components/NavMenu'; -import Home from './components/public/Home'; -import Genres from './components/public/Genres'; -import GenreDetails from './components/public/GenreDetails'; -import AlbumDetails from './components/public/AlbumDetails'; - -class Layout extends React.Component<{ body: React.ReactElement }, void> { - public render() { - return
    - -
    - { this.props.body } -
    -
    ; - } -} - -export const routes = - - - - -; diff --git a/samples/react/MusicStore/ReactApp/store/AlbumDetails.ts b/samples/react/MusicStore/ReactApp/store/AlbumDetails.ts deleted file mode 100644 index ad3f458e..00000000 --- a/samples/react/MusicStore/ReactApp/store/AlbumDetails.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { fetch, addTask } from 'domain-task'; -import { typeName, isActionType, Action, Reducer } from 'redux-typed'; -import { ActionCreator } from './'; -import { Genre } from './GenreList'; - -// ----------------- -// STATE - This defines the type of data maintained in the Redux store. - -export interface AlbumDetailsState { - album: AlbumDetails; - requestedAlbumId: number; -} - -export interface AlbumDetails { - AlbumId: number; - Title: string; - AlbumArtUrl: string; - Genre: Genre; - Artist: Artist; - Price: number; -} - -interface Artist { - Name: string; -} - -// ----------------- -// ACTIONS - These are serializable (hence replayable) descriptions of state transitions. -// They do not themselves have any side-effects; they just describe something that is going to happen. -// Use @typeName and isActionType for type detection that works even after serialization/deserialization. - -@typeName("REQUEST_ALBUM_DETAILS") -class RequestAlbumDetails extends Action { - constructor(public albumId: number) { - super(); - } -} - -@typeName("RECEIVE_ALBUM_DETAILS") -class ReceiveAlbumDetails extends Action { - constructor(public album: AlbumDetails) { - super(); - } -} - -// ---------------- -// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition. -// They don't directly mutate state, but they can have external side-effects (such as loading data). - -export const actionCreators = { - requestAlbumDetails: (albumId: number): ActionCreator => (dispatch, getState) => { - // Only load if it's not already loaded (or currently being loaded) - if (albumId !== getState().albumDetails.requestedAlbumId) { - let fetchTask = fetch(`/api/albums/${ albumId }`) - .then(results => results.json()) - .then(album => { - // Only replace state if it's still the most recent request - if (albumId === getState().albumDetails.requestedAlbumId) { - dispatch(new ReceiveAlbumDetails(album)); - } - }); - - addTask(fetchTask); // Ensure server-side prerendering waits for this to complete - dispatch(new RequestAlbumDetails(albumId)); - } - } -}; - -// ---------------- -// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state. -// For unrecognized actions, must return the existing state (or default initial state if none was supplied). -const unloadedState: AlbumDetailsState = { requestedAlbumId: null as number, album: null }; -export const reducer: Reducer = (state, action) => { - if (isActionType(action, RequestAlbumDetails)) { - return { requestedAlbumId: action.albumId, album: null }; - } else if (isActionType(action, ReceiveAlbumDetails)) { - return { requestedAlbumId: action.album.AlbumId, album: action.album }; - } else { - return state || unloadedState; - } -}; diff --git a/samples/react/MusicStore/ReactApp/store/FeaturedAlbums.ts b/samples/react/MusicStore/ReactApp/store/FeaturedAlbums.ts deleted file mode 100644 index f9e78282..00000000 --- a/samples/react/MusicStore/ReactApp/store/FeaturedAlbums.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { fetch, addTask } from 'domain-task'; -import { typeName, isActionType, Action, Reducer } from 'redux-typed'; -import { ActionCreator } from './'; - -// ----------------- -// STATE - This defines the type of data maintained in the Redux store. - -export interface FeaturedAlbumsState { - albums: Album[]; - isLoaded: boolean; -} - -export interface Album { - AlbumId: number; - Title: string; - AlbumArtUrl: string; -} - -// ----------------- -// ACTIONS - These are serializable (hence replayable) descriptions of state transitions. -// They do not themselves have any side-effects; they just describe something that is going to happen. -// Use @typeName and isActionType for type detection that works even after serialization/deserialization. - -@typeName("REQUEST_FEATURED_ALBUMS") -class RequestFeaturedAlbums extends Action { -} - -@typeName("RECEIVE_FEATURED_ALBUMS") -class ReceiveFeaturedAlbums extends Action { - constructor(public albums: Album[]) { - super(); - } -} - -// ---------------- -// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition. -// They don't directly mutate state, but they can have external side-effects (such as loading data). - -export const actionCreators = { - requestFeaturedAlbums: (): ActionCreator => (dispatch, getState) => { - if (!getState().featuredAlbums.isLoaded) { - let fetchTask = fetch('http://github.com/api/albums/mostPopular') - .then(results => results.json()) - .then(albums => dispatch(new ReceiveFeaturedAlbums(albums))); - - addTask(fetchTask); // Ensure server-side prerendering waits for this to complete - return dispatch(new RequestFeaturedAlbums()); - } - } -}; - -// ---------------- -// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state. -// For unrecognized actions, must return the existing state (or default initial state if none was supplied). - -export const reducer: Reducer = (state, action) => { - if (isActionType(action, ReceiveFeaturedAlbums)) { - return { albums: action.albums, isLoaded: true }; - } else { - return state || { albums: [], isLoaded: false }; - } -}; diff --git a/samples/react/MusicStore/ReactApp/store/GenreDetails.ts b/samples/react/MusicStore/ReactApp/store/GenreDetails.ts deleted file mode 100644 index 24848a10..00000000 --- a/samples/react/MusicStore/ReactApp/store/GenreDetails.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { fetch, addTask } from 'domain-task'; -import { typeName, isActionType, Action, Reducer } from 'redux-typed'; -import { ActionCreator } from './'; -import { Album } from './FeaturedAlbums'; - -// ----------------- -// STATE - This defines the type of data maintained in the Redux store. - -export interface GenreDetailsState { - requestedGenreId: number; - albums: Album[]; - isLoaded: boolean; -} - -// ----------------- -// ACTIONS - These are serializable (hence replayable) descriptions of state transitions. -// They do not themselves have any side-effects; they just describe something that is going to happen. -// Use @typeName and isActionType for type detection that works even after serialization/deserialization. - -@typeName("REQUEST_GENRE_DETAILS") -class RequestGenreDetails extends Action { - constructor(public genreId: number) { - super(); - } -} - -@typeName("RECEIVE_GENRE_DETAILS") -class ReceiveGenreDetails extends Action { - constructor(public genreId: number, public albums: Album[]) { - super(); - } -} - -// ---------------- -// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition. -// They don't directly mutate state, but they can have external side-effects (such as loading data). - -export const actionCreators = { - requestGenreDetails: (genreId: number): ActionCreator => (dispatch, getState) => { - // Only load if it's not already loaded (or currently being loaded) - if (genreId !== getState().genreDetails.requestedGenreId) { - let fetchTask = fetch(`/api/genres/${ genreId }/albums`) - .then(results => results.json()) - .then(albums => { - // Only replace state if it's still the most recent request - if (genreId === getState().genreDetails.requestedGenreId) { - dispatch(new ReceiveGenreDetails(genreId, albums)); - } - }); - - addTask(fetchTask); // Ensure server-side prerendering waits for this to complete - dispatch(new RequestGenreDetails(genreId)); - } - } -}; - -// ---------------- -// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state. -// For unrecognized actions, must return the existing state (or default initial state if none was supplied). -export const reducer: Reducer = (state, action) => { - if (isActionType(action, RequestGenreDetails)) { - return { requestedGenreId: action.genreId, albums: [], isLoaded: false }; - } else if (isActionType(action, ReceiveGenreDetails)) { - return { requestedGenreId: action.genreId, albums: action.albums, isLoaded: true }; - } else { - return state || { requestedGenreId: null as number, albums: [], isLoaded: false }; - } -}; diff --git a/samples/react/MusicStore/ReactApp/store/GenreList.ts b/samples/react/MusicStore/ReactApp/store/GenreList.ts deleted file mode 100644 index 8843f22e..00000000 --- a/samples/react/MusicStore/ReactApp/store/GenreList.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { fetch, addTask } from 'domain-task'; -import { typeName, isActionType, Action, Reducer } from 'redux-typed'; -import { ActionCreator } from './'; - -// ----------------- -// STATE - This defines the type of data maintained in the Redux store. - -export interface GenresListState { - genres: Genre[]; - isLoaded: boolean; -} - -export interface Genre { - GenreId: string; - Name: string; -} - -// ----------------- -// ACTIONS - These are serializable (hence replayable) descriptions of state transitions. -// They do not themselves have any side-effects; they just describe something that is going to happen. -// Use @typeName and isActionType for type detection that works even after serialization/deserialization. - -@typeName("RECEIVE_GENRES_LIST") -class ReceiveGenresList extends Action { - constructor(public genres: Genre[]) { - super(); - } -} - -// ---------------- -// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition. -// They don't directly mutate state, but they can have external side-effects (such as loading data). - -export const actionCreators = { - requestGenresList: (): ActionCreator => (dispatch, getState) => { - if (!getState().genreList.isLoaded) { - let fetchTask = fetch('http://github.com/api/genres') - .then(results => results.json()) - .then(genres => dispatch(new ReceiveGenresList(genres))); - addTask(fetchTask); // Ensure server-side prerendering waits for this to complete - } - } -}; - -// ---------------- -// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state. -// For unrecognized actions, must return the existing state (or default initial state if none was supplied). - -export const reducer: Reducer = (state, action) => { - if (isActionType(action, ReceiveGenresList)) { - return { genres: action.genres, isLoaded: true }; - } else { - return state || { genres: [], isLoaded: false }; - } -}; diff --git a/samples/react/MusicStore/ReactApp/store/index.ts b/samples/react/MusicStore/ReactApp/store/index.ts deleted file mode 100644 index 50f6178c..00000000 --- a/samples/react/MusicStore/ReactApp/store/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ActionCreatorGeneric } from 'redux-typed'; -import * as FeaturedAlbums from './FeaturedAlbums'; -import * as GenreList from './GenreList'; -import * as GenreDetails from './GenreDetails'; -import * as AlbumDetails from './AlbumDetails'; - -// The top-level state object -export interface ApplicationState { - featuredAlbums: FeaturedAlbums.FeaturedAlbumsState; - genreList: GenreList.GenresListState, - genreDetails: GenreDetails.GenreDetailsState, - albumDetails: AlbumDetails.AlbumDetailsState -} - -// Whenever an action is dispatched, Redux will update each top-level application state property using -// the reducer with the matching name. It's important that the names match exactly, and that the reducer -// acts on the corresponding ApplicationState property type. -export const reducers = { - featuredAlbums: FeaturedAlbums.reducer, - genreList: GenreList.reducer, - genreDetails: GenreDetails.reducer, - albumDetails: AlbumDetails.reducer -}; - -// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are -// correctly typed to match your store. -export type ActionCreator = ActionCreatorGeneric; diff --git a/samples/react/MusicStore/ReactApp/styles/styles.css b/samples/react/MusicStore/ReactApp/styles/styles.css deleted file mode 100644 index a8fc8a14..00000000 --- a/samples/react/MusicStore/ReactApp/styles/styles.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - padding-top: 50px; -} diff --git a/samples/react/MusicStore/SiteSettings.cs b/samples/react/MusicStore/SiteSettings.cs deleted file mode 100644 index 50a86c24..00000000 --- a/samples/react/MusicStore/SiteSettings.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace MusicStore -{ - public class SiteSettings - { - public string DefaultAdminUsername { get; set; } - public string DefaultAdminPassword { get; set; } - } -} diff --git a/samples/react/MusicStore/Startup.cs b/samples/react/MusicStore/Startup.cs deleted file mode 100755 index 4ea3fec3..00000000 --- a/samples/react/MusicStore/Startup.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Microsoft.AspNetCore.SpaServices.Webpack; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.PlatformAbstractions; -using AutoMapper; -using MusicStore.Apis; -using MusicStore.Models; -using Newtonsoft.Json.Serialization; - -namespace MusicStore -{ - public class Startup - { - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc().AddJsonOptions(options => - { - options.SerializerSettings.ContractResolver = null; - }); - - // Add EF services to the service container - services.AddEntityFramework() - .AddEntityFrameworkSqlite() - .AddDbContext(options => { - options.UseSqlite("Data Source=music-db.sqlite"); - }); - - // Add Identity services to the services container - services.AddIdentity() - .AddEntityFrameworkStores() - .AddDefaultTokenProviders(); - - // Configure Auth - services.Configure(options => - { - options.AddPolicy("app-ManageStore", new AuthorizationPolicyBuilder().RequireClaim("app-ManageStore", "Allowed").Build()); - }); - - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - Mapper.CreateMap(); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHostingEnvironment env) - { - app.UseDeveloperExceptionPage(); - - // Initialize the sample data - SampleData.InitializeMusicStoreDatabaseAsync(app.ApplicationServices).Wait(); - - // In dev mode, the JS/TS/etc is compiled and served dynamically and supports hot replacement. - // In production, we assume you've used webpack to emit the prebuilt content to disk. - if (env.IsDevelopment()) { - app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { - HotModuleReplacement = true, - ReactHotModuleReplacement = true - }); - } - - app.UseStaticFiles(); - loggerFactory.AddConsole(); - - // Add MVC to the request pipeline. - app.UseMvc(routes => - { - // Matches requests that correspond to an existent controller/action pair - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - - // Matches any other request that doesn't appear to have a filename extension (defined as 'having a dot in the last URI segment'). - // This means you'll correctly get 404s for /some/dir/non-existent-image.png instead of returning the SPA HTML. - // However, it means requests like /customers/isaac.newton will *not* be mapped into the SPA, so if you need to accept - // URIs like that you'll need to match all URIs, e.g.: - // routes.MapRoute("spa-fallback", "{*anything}", new { controller = "Home", action = "Index" }); - // (which of course will match /customers/isaac.png too, so in that case it would serve the PNG image at that URL if one is on disk, - // or the SPA HTML if not). - routes.MapSpaFallbackRoute("spa-fallback", new { controller = "Home", action = "Index" }); - }); - } - - public static void Main(string[] args) - { - var host = new WebHostBuilder() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseKestrel() - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/samples/react/MusicStore/Views/Home/Index.cshtml b/samples/react/MusicStore/Views/Home/Index.cshtml deleted file mode 100755 index 9595e016..00000000 --- a/samples/react/MusicStore/Views/Home/Index.cshtml +++ /dev/null @@ -1,11 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - -
    - -@section scripts { - - -} diff --git a/samples/react/MusicStore/Views/Shared/Error.cshtml b/samples/react/MusicStore/Views/Shared/Error.cshtml deleted file mode 100755 index 473b35d6..00000000 --- a/samples/react/MusicStore/Views/Shared/Error.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ViewData["Title"] = "Error"; -} - -

    Error.

    -

    An error occurred while processing your request.

    diff --git a/samples/react/MusicStore/Views/Shared/_Layout.cshtml b/samples/react/MusicStore/Views/Shared/_Layout.cshtml deleted file mode 100755 index 47e4e48f..00000000 --- a/samples/react/MusicStore/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - @ViewData["Title"] - - - - @RenderBody() - @RenderSection("scripts", required: false) - - diff --git a/samples/react/MusicStore/Views/_ViewImports.cshtml b/samples/react/MusicStore/Views/_ViewImports.cshtml deleted file mode 100755 index 17302928..00000000 --- a/samples/react/MusicStore/Views/_ViewImports.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@using MusicStore -@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" -@addTagHelper "*, Microsoft.AspNetCore.SpaServices" diff --git a/samples/react/MusicStore/Views/_ViewStart.cshtml b/samples/react/MusicStore/Views/_ViewStart.cshtml deleted file mode 100755 index 820a2f6e..00000000 --- a/samples/react/MusicStore/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/samples/react/MusicStore/package.json b/samples/react/MusicStore/package.json deleted file mode 100644 index 084f8ee9..00000000 --- a/samples/react/MusicStore/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "MusicStore", - "version": "0.0.0", - "devDependencies": { - "babel-loader": "^6.2.1", - "babel-plugin-react-transform": "^2.0.0", - "babel-preset-es2015": "^6.3.13", - "babel-preset-react": "^6.3.13", - "css-loader": "^0.23.1", - "express": "^4.13.4", - "extract-text-webpack-plugin": "^1.0.1", - "file-loader": "^0.8.5", - "react-transform-hmr": "^1.0.2", - "style-loader": "^0.13.0", - "ts-loader": "^0.8.0", - "typescript": "^1.7.5", - "url-loader": "^0.5.7", - "webpack": "^1.12.12", - "webpack-dev-middleware": "^1.5.1", - "webpack-hot-middleware": "^2.6.4" - }, - "dependencies": { - "aspnet-prerendering": "^1.0.0", - "aspnet-webpack": "^1.0.3", - "aspnet-webpack-react": "^1.0.1", - "bootstrap": "^3.3.6", - "domain-context": "^0.5.1", - "domain-task": "^2.0.0", - "history": "^2.0.0", - "isomorphic-fetch": "^2.2.1", - "memory-fs": "^0.3.0", - "react": "^0.14.7", - "react-bootstrap": "^0.28.2", - "react-dom": "^0.14.7", - "react-redux": "^4.2.1", - "react-router": "^2.0.0-rc5", - "react-router-bootstrap": "^0.20.1", - "react-router-redux": "^2.1.0", - "redux": "^3.2.1", - "redux-thunk": "^1.0.3", - "redux-typed": "^1.0.0", - "require-from-string": "^1.1.0", - "webpack-externals-plugin": "^1.0.0" - } -} diff --git a/samples/react/MusicStore/project.json b/samples/react/MusicStore/project.json deleted file mode 100755 index faebf7ac..00000000 --- a/samples/react/MusicStore/project.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - "runtimeOptions": { - "gcServer": true - }, - "tooling": { - "defaultNamespace": "MusicStore" - }, - -"dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.0", - "type": "platform" - }, - "Microsoft.AspNetCore.Diagnostics": "1.0.0", - "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", - "Microsoft.AspNetCore.Mvc": "1.0.0", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", - "Microsoft.AspNetCore.StaticFiles": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Logging.Console": "1.0.0", - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.Extensions.Logging.Debug": "1.0.0", - "Microsoft.EntityFrameworkCore.SQLite": "1.0.0", - "Microsoft.AspNetCore.ReactServices": "1.0.0-*", - "AutoMapper": "4.1.1" - }, - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "dotnet5.6", - "dnxcore50", - "portable-net45+win8" - ] - } - }, - "publishOptions": { - "exclude": [ - "node_modules", - "bower_components", - "**.xproj", - "**.user", - "**.vspscc" - ] - }, - "scripts": { - "prepublish": [ "npm install" ], - "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] - } -} diff --git a/samples/react/MusicStore/tsconfig.json b/samples/react/MusicStore/tsconfig.json deleted file mode 100644 index 863f6938..00000000 --- a/samples/react/MusicStore/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "node", - "target": "es6", - "jsx": "preserve", - "sourceMap": true, - "experimentalDecorators": true - }, - "exclude": [ - "node_modules" - ] -} diff --git a/samples/react/MusicStore/tsd.json b/samples/react/MusicStore/tsd.json deleted file mode 100644 index cebcea0b..00000000 --- a/samples/react/MusicStore/tsd.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "version": "v4", - "repo": "borisyankov/DefinitelyTyped", - "ref": "master", - "path": "typings", - "bundle": "typings/tsd.d.ts", - "installed": { - "react/react.d.ts": { - "commit": "e69fe60f2d6377ea4fae539493997b098f52cad1" - }, - "react/react-dom.d.ts": { - "commit": "86dbea8fc37d9473fee465da4f0a21bea4f8cbd9" - }, - "redux/redux.d.ts": { - "commit": "e69fe60f2d6377ea4fae539493997b098f52cad1" - }, - "webpack/webpack-env.d.ts": { - "commit": "717a5fdb079f8dd7c19f1b22f7f656dd990f0ccf" - }, - "react-redux/react-redux.d.ts": { - "commit": "717a5fdb079f8dd7c19f1b22f7f656dd990f0ccf" - }, - "react-bootstrap/react-bootstrap.d.ts": { - "commit": "e69fe60f2d6377ea4fae539493997b098f52cad1" - }, - "react-router/react-router.d.ts": { - "commit": "e69fe60f2d6377ea4fae539493997b098f52cad1" - }, - "react-router/history.d.ts": { - "commit": "e69fe60f2d6377ea4fae539493997b098f52cad1" - }, - "react-router-bootstrap/react-router-bootstrap.d.ts": { - "commit": "e69fe60f2d6377ea4fae539493997b098f52cad1" - }, - "react-router-redux/react-router-redux.d.ts": { - "commit": "e69fe60f2d6377ea4fae539493997b098f52cad1" - }, - "redux-thunk/redux-thunk.d.ts": { - "commit": "e69fe60f2d6377ea4fae539493997b098f52cad1" - }, - "whatwg-fetch/whatwg-fetch.d.ts": { - "commit": "f4b1797c1201b6c575668f5d7ea12d9b1ab21846" - } - } -} diff --git a/samples/react/MusicStore/typings/react-bootstrap/react-bootstrap.d.ts b/samples/react/MusicStore/typings/react-bootstrap/react-bootstrap.d.ts deleted file mode 100644 index c6e30d08..00000000 --- a/samples/react/MusicStore/typings/react-bootstrap/react-bootstrap.d.ts +++ /dev/null @@ -1,976 +0,0 @@ -// Type definitions for react-bootstrap -// Project: https://github.com/react-bootstrap/react-bootstrap -// Definitions by: Walker Burgin -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module "react-bootstrap" { - // Import React - import React = require("react"); - - - // - WebApplicationBasic - -
    - - - diff --git a/templates/Angular2Spa/ClientApp/components/nav-menu/nav-menu.ts b/templates/Angular2Spa/ClientApp/components/nav-menu/nav-menu.ts deleted file mode 100644 index 9c525ec5..00000000 --- a/templates/Angular2Spa/ClientApp/components/nav-menu/nav-menu.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as ng from '@angular/core'; -import { ROUTER_DIRECTIVES } from '@angular/router'; - -@ng.Component({ - selector: 'nav-menu', - template: require('./nav-menu.html'), - directives: [...ROUTER_DIRECTIVES] -}) -export class NavMenu { -} diff --git a/templates/Angular2Spa/ClientApp/routes.ts b/templates/Angular2Spa/ClientApp/routes.ts deleted file mode 100644 index d693c44a..00000000 --- a/templates/Angular2Spa/ClientApp/routes.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { RouterConfig } from '@angular/router'; -import { Home } from './components/home/home'; -import { FetchData } from './components/fetch-data/fetch-data'; -import { Counter } from './components/counter/counter'; - -export const routes: RouterConfig = [ - { path: '', redirectTo: 'home' }, - { path: 'home', component: Home }, - { path: 'counter', component: Counter }, - { path: 'fetch-data', component: FetchData }, - { path: '**', redirectTo: 'home' } -]; diff --git a/templates/Angular2Spa/ClientApp/styles/site.css b/templates/Angular2Spa/ClientApp/styles/site.css deleted file mode 100644 index 18a995fa..00000000 --- a/templates/Angular2Spa/ClientApp/styles/site.css +++ /dev/null @@ -1,66 +0,0 @@ -@media (max-width: 767px) { - /* On small screens, the nav menu spans the full width of the screen. Leave a space for it. */ - .body-content { - padding-top: 50px; - } -} - -.main-nav li .glyphicon { - margin-right: 10px; -} - -/* Highlighting rules for nav menu items */ -.main-nav li.link-active a, -.main-nav li.link-active a:hover, -.main-nav li.link-active a:focus { - background-color: #4189C7; - color: white; -} - -/* Keep the nav menu independent of scrolling and on top of other items */ -.main-nav { - position: fixed; - top: 0; - left: 0; - right: 0; - z-index: 1; -} - -@media (min-width: 768px) { - /* On small screens, convert the nav menu to a vertical sidebar */ - .main-nav { - height: 100%; - width: calc(25% - 20px); - } - .main-nav .navbar { - border-radius: 0px; - border-width: 0px; - height: 100%; - } - .main-nav .navbar-header { - float: none; - } - .main-nav .navbar-collapse { - border-top: 1px solid #444; - padding: 0px; - } - .main-nav .navbar ul { - float: none; - } - .main-nav .navbar li { - float: none; - font-size: 15px; - margin: 6px; - } - .main-nav .navbar li a { - padding: 10px 16px; - border-radius: 4px; - } - .main-nav .navbar a { - /* If a menu item's text is too long, truncate it */ - width: 100%; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } -} diff --git a/templates/Angular2Spa/Controllers/HomeController.cs b/templates/Angular2Spa/Controllers/HomeController.cs deleted file mode 100755 index 9d75da88..00000000 --- a/templates/Angular2Spa/Controllers/HomeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace WebApplicationBasic.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - - public IActionResult Error() - { - return View(); - } - } -} diff --git a/templates/Angular2Spa/Controllers/SampleDataController.cs b/templates/Angular2Spa/Controllers/SampleDataController.cs deleted file mode 100644 index 1f46d127..00000000 --- a/templates/Angular2Spa/Controllers/SampleDataController.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace WebApplicationBasic.Controllers -{ - [Route("api/[controller]")] - public class SampleDataController : Controller - { - private static string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - [HttpGet("[action]")] - public IEnumerable WeatherForecasts() - { - var rng = new Random(); - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - DateFormatted = DateTime.Now.AddDays(index).ToString("d"), - TemperatureC = rng.Next(-20, 55), - Summary = Summaries[rng.Next(Summaries.Length)] - }); - } - - public class WeatherForecast - { - public string DateFormatted { get; set; } - public int TemperatureC { get; set; } - public string Summary { get; set; } - - public int TemperatureF - { - get - { - return 32 + (int)(this.TemperatureC / 0.5556); - } - } - } - } -} diff --git a/templates/Angular2Spa/Dockerfile b/templates/Angular2Spa/Dockerfile deleted file mode 100644 index 63d7c456..00000000 --- a/templates/Angular2Spa/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM microsoft/aspnet:1.0.0-rc1-update1 - -RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list -RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/* - -COPY . /app -WORKDIR /app -RUN ["dnu", "restore"] - -EXPOSE 5000/tcp -ENTRYPOINT ["dnx", "-p", "project.json", "web"] diff --git a/templates/Angular2Spa/README.md b/templates/Angular2Spa/README.md deleted file mode 100644 index 4e494c9a..00000000 --- a/templates/Angular2Spa/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Welcome to ASP.NET 5 - -We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. - -You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) - -## This application consists of: - -* Sample pages using ASP.NET MVC 6 -* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side libraries -* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) - -## How to - -* [Add a Controller and View](http://go.microsoft.com/fwlink/?LinkID=398600) -* [Add an appsetting in config and access it in app.](http://go.microsoft.com/fwlink/?LinkID=699562) -* [Manage User Secrets using Secret Manager.](http://go.microsoft.com/fwlink/?LinkId=699315) -* [Use logging to log a message.](http://go.microsoft.com/fwlink/?LinkId=699316) -* [Add packages using NuGet.](http://go.microsoft.com/fwlink/?LinkId=699317) -* [Add client packages using Bower.](http://go.microsoft.com/fwlink/?LinkId=699318) -* [Target development, staging or production environment.](http://go.microsoft.com/fwlink/?LinkId=699319) - -## Overview - -* [Conceptual overview of what is ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518008) -* [Fundamentals of ASP.NET 5 such as Startup and middleware.](http://go.microsoft.com/fwlink/?LinkId=699320) -* [Working with Data](http://go.microsoft.com/fwlink/?LinkId=398602) -* [Security](http://go.microsoft.com/fwlink/?LinkId=398603) -* [Client side development](http://go.microsoft.com/fwlink/?LinkID=699321) -* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=699322) -* [Read more on the documentation site](http://go.microsoft.com/fwlink/?LinkID=699323) - -## Run & Deploy - -* [Run your app](http://go.microsoft.com/fwlink/?LinkID=517851) -* [Run your app on .NET Core](http://go.microsoft.com/fwlink/?LinkID=517852) -* [Run commands in your project.json](http://go.microsoft.com/fwlink/?LinkID=517853) -* [Publish to Microsoft Azure Web Apps](http://go.microsoft.com/fwlink/?LinkID=398609) - -We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/templates/Angular2Spa/Startup.cs b/templates/Angular2Spa/Startup.cs deleted file mode 100755 index 0c5cc48c..00000000 --- a/templates/Angular2Spa/Startup.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.SpaServices.Webpack; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Newtonsoft.Json.Serialization; - -namespace WebApplicationBasic -{ - public class Startup - { - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc().AddJsonOptions(options => - { - options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); - }); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHostingEnvironment env) - { - app.UseDeveloperExceptionPage(); - - if (env.IsDevelopment()) { - app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { - HotModuleReplacement = true - }); - } - - app.UseStaticFiles(); - loggerFactory.AddConsole(); - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - - routes.MapSpaFallbackRoute( - name: "spa-fallback", - defaults: new { controller = "Home", action = "Index" }); - }); - } - - public static void Main(string[] args) - { - var host = new WebHostBuilder() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseKestrel() - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/templates/Angular2Spa/Views/Home/Index.cshtml b/templates/Angular2Spa/Views/Home/Index.cshtml deleted file mode 100644 index 6adad5ca..00000000 --- a/templates/Angular2Spa/Views/Home/Index.cshtml +++ /dev/null @@ -1,11 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - -Loading... - - -@section scripts { - -} diff --git a/templates/Angular2Spa/Views/Shared/Error.cshtml b/templates/Angular2Spa/Views/Shared/Error.cshtml deleted file mode 100755 index 473b35d6..00000000 --- a/templates/Angular2Spa/Views/Shared/Error.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ViewData["Title"] = "Error"; -} - -

    Error.

    -

    An error occurred while processing your request.

    diff --git a/templates/Angular2Spa/Views/Shared/_Layout.cshtml b/templates/Angular2Spa/Views/Shared/_Layout.cshtml deleted file mode 100644 index 90d892bc..00000000 --- a/templates/Angular2Spa/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - @ViewData["Title"] - WebApplicationBasic - - - - - - @RenderBody() - - @RenderSection("scripts", required: false) - - diff --git a/templates/Angular2Spa/Views/_ViewImports.cshtml b/templates/Angular2Spa/Views/_ViewImports.cshtml deleted file mode 100755 index e7b4f83f..00000000 --- a/templates/Angular2Spa/Views/_ViewImports.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@using WebApplicationBasic -@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" -@addTagHelper "*, Microsoft.AspNetCore.SpaServices" diff --git a/templates/Angular2Spa/Views/_ViewStart.cshtml b/templates/Angular2Spa/Views/_ViewStart.cshtml deleted file mode 100755 index 820a2f6e..00000000 --- a/templates/Angular2Spa/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/templates/Angular2Spa/appsettings.json b/templates/Angular2Spa/appsettings.json deleted file mode 100755 index e5472e56..00000000 --- a/templates/Angular2Spa/appsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Verbose", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/templates/Angular2Spa/package.json b/templates/Angular2Spa/package.json deleted file mode 100644 index 047a6ead..00000000 --- a/templates/Angular2Spa/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "WebApplicationBasic", - "version": "0.0.0", - "devDependencies": { - "bootstrap": "^3.3.6", - "css-loader": "^0.23.1", - "expose-loader": "^0.7.1", - "extendify": "^1.0.0", - "extract-text-webpack-plugin": "^1.0.1", - "file-loader": "^0.8.5", - "jquery": "^2.2.1", - "raw-loader": "^0.5.1", - "style-loader": "^0.13.0", - "ts-loader": "^0.8.1", - "typescript": "^1.8.2", - "url-loader": "^0.5.7", - "webpack": "^1.12.14", - "webpack-hot-middleware": "^2.10.0" - }, - "dependencies": { - "@angular/common": "2.0.0-rc.3", - "@angular/compiler": "2.0.0-rc.3", - "@angular/core": "2.0.0-rc.3", - "@angular/http": "2.0.0-rc.3", - "@angular/platform-browser": "2.0.0-rc.3", - "@angular/platform-browser-dynamic": "2.0.0-rc.3", - "@angular/platform-server": "2.0.0-rc.3", - "@angular/router": "3.0.0-alpha.8", - "angular2-universal": "^0.104.1", - "aspnet-prerendering": "^1.0.2", - "aspnet-webpack": "^1.0.1", - "css": "^2.2.1", - "isomorphic-fetch": "^2.2.1", - "preboot": "^2.0.10", - "rxjs": "5.0.0-beta.6", - "webpack-externals-plugin": "^1.0.0", - "zone.js": "^0.6.12" - } -} diff --git a/templates/Angular2Spa/project.json b/templates/Angular2Spa/project.json deleted file mode 100755 index 1ce5f413..00000000 --- a/templates/Angular2Spa/project.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.0", - "type": "platform" - }, - "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", - "Microsoft.AspNetCore.AngularServices": "1.0.0-*", - "Microsoft.AspNetCore.Diagnostics": "1.0.0", - "Microsoft.AspNetCore.Mvc": "1.0.0", - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", - "Microsoft.AspNetCore.StaticFiles": "1.0.0", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Logging": "1.0.0", - "Microsoft.Extensions.Logging.Console": "1.0.0", - "Microsoft.Extensions.Logging.Debug": "1.0.0", - "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { - "version": "1.0.0-preview2-final", - "type": "build" - } - }, - - "tools": { - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.AspNetCore.Server.IISIntegration.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.EntityFrameworkCore.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - }, - "Microsoft.Extensions.SecretManager.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - }, - "Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final" - }, - - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "dotnet5.6", - "dnxcore50", - "portable-net45+win8" - ] - } - }, - - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - - "runtimeOptions": { - "configProperties": { - "System.GC.Server": true - } - }, - - "publishOptions": { - "include": [ - "appsettings.json", - "ClientApp", - "node_modules", - "typings", - "Views", - "tsconfig.json", - "tsd.json", - "web.config", - "webpack.*.js", - "wwwroot" - ] - }, - - "scripts": { - "prepublish": [ - "npm install", - "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js", - "node node_modules/webpack/bin/webpack.js" - ], - "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] - }, - - "tooling": { - "defaultNamespace": "WebApplicationBasic" - } -} diff --git a/templates/Angular2Spa/template_gitignore b/templates/Angular2Spa/template_gitignore deleted file mode 100644 index d410b8bb..00000000 --- a/templates/Angular2Spa/template_gitignore +++ /dev/null @@ -1,237 +0,0 @@ -/Properties/launchSettings.json - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -bin/ -Bin/ -obj/ -Obj/ - -# Visual Studio 2015 cache/options directory -.vs/ -/wwwroot/dist/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Microsoft Azure ApplicationInsights config file -ApplicationInsights.config - -# Windows Store app package directory -AppPackages/ -BundleArtifacts/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe - -# FAKE - F# Make -.fake/ diff --git a/templates/Angular2Spa/tsconfig.json b/templates/Angular2Spa/tsconfig.json deleted file mode 100644 index ef5deed5..00000000 --- a/templates/Angular2Spa/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "node", - "target": "es5", - "sourceMap": true, - "experimentalDecorators": true, - "emitDecoratorMetadata": true, - "skipDefaultLibCheck": true - }, - "exclude": [ - "node_modules" - ] -} diff --git a/templates/Angular2Spa/tsd.json b/templates/Angular2Spa/tsd.json deleted file mode 100644 index b39437eb..00000000 --- a/templates/Angular2Spa/tsd.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "v4", - "repo": "borisyankov/DefinitelyTyped", - "ref": "master", - "path": "typings", - "bundle": "typings/tsd.d.ts", - "installed": { - "requirejs/require.d.ts": { - "commit": "dade4414712ce84e3c63393f1aae407e9e7e6af7" - }, - "es6-shim/es6-shim.d.ts": { - "commit": "c0d876601e0f8236fd6b57626eb62c4e485f1563" - } - } -} diff --git a/templates/Angular2Spa/typings/es6-shim/es6-shim.d.ts b/templates/Angular2Spa/typings/es6-shim/es6-shim.d.ts deleted file mode 100644 index 41f22997..00000000 --- a/templates/Angular2Spa/typings/es6-shim/es6-shim.d.ts +++ /dev/null @@ -1,668 +0,0 @@ -// Type definitions for es6-shim v0.31.2 -// Project: https://github.com/paulmillr/es6-shim -// Definitions by: Ron Buckton -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare type PropertyKey = string | number | symbol; - -interface IteratorResult { - done: boolean; - value?: T; -} - -interface IterableShim { - /** - * Shim for an ES6 iterable. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): Iterator; -} - -interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} - -interface IterableIteratorShim extends IterableShim, Iterator { - /** - * Shim for an ES6 iterable iterator. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): IterableIteratorShim; -} - -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 String { - /** - * 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. - */ - includes(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 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; - - /** - * Shim for an ES6 iterable. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): IterableIteratorShim; -} - -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: IterableShim, 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: IterableShim): 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 Array { - /** - * 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[]; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIteratorShim<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIteratorShim; - - /** - * Returns an list of values in the array - */ - values(): IterableIteratorShim; - - /** - * Shim for an ES6 iterable. Not intended for direct use by user code. - */ - "_es6-shim iterator_"(): IterableIteratorShim; -} - -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 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 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. - * @remarks Requires `__proto__` support. - */ - setPrototypeOf(o: any, proto: any): any; -} - -interface RegExp { - /** - * 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; -} - -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; -} - -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; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): 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; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): 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; - catch(onrejected?: (reason: any) => void): Promise; -} - -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: IterableShim>): 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: IterableShim>): 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; -} - -declare var Promise: PromiseConstructor; - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): Map; - size: number; - entries(): IterableIteratorShim<[K, V]>; - keys(): IterableIteratorShim; - values(): IterableIteratorShim; -} - -interface MapConstructor { - new (): Map; - new (iterable: IterableShim<[K, V]>): Map; - prototype: Map; -} - -declare var Map: MapConstructor; - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; - entries(): IterableIteratorShim<[T, T]>; - keys(): IterableIteratorShim; - values(): IterableIteratorShim; -} - -interface SetConstructor { - new (): Set; - new (iterable: IterableShim): Set; - prototype: Set; -} - -declare var Set: SetConstructor; - -interface WeakMap { - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): WeakMap; -} - -interface WeakMapConstructor { - new (): WeakMap; - new (iterable: IterableShim<[K, V]>): WeakMap; - prototype: WeakMap; -} - -declare var WeakMap: WeakMapConstructor; - -interface WeakSet { - add(value: T): WeakSet; - delete(value: T): boolean; - has(value: T): boolean; -} - -interface WeakSetConstructor { - new (): WeakSet; - new (iterable: IterableShim): WeakSet; - prototype: WeakSet; -} - -declare var WeakSet: WeakSetConstructor; - -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): IterableIteratorShim; - 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: PropertyKey): 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; -} - -declare module "es6-shim" { - var String: StringConstructor; - var Array: ArrayConstructor; - var Number: NumberConstructor; - var Math: Math; - var Object: ObjectConstructor; - var Map: MapConstructor; - var Set: SetConstructor; - var WeakMap: WeakMapConstructor; - var WeakSet: WeakSetConstructor; - var Promise: PromiseConstructor; - 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): Iterator; - 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: PropertyKey): 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; - } -} diff --git a/templates/Angular2Spa/typings/requirejs/require.d.ts b/templates/Angular2Spa/typings/requirejs/require.d.ts deleted file mode 100644 index e9cdb3e8..00000000 --- a/templates/Angular2Spa/typings/requirejs/require.d.ts +++ /dev/null @@ -1,397 +0,0 @@ -// Type definitions for RequireJS 2.1.20 -// Project: http://requirejs.org/ -// Definitions by: Josh Baldwin -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/* -require-2.1.8.d.ts may be freely distributed under the MIT license. - -Copyright (c) 2013 Josh Baldwin https://github.com/jbaldwin/require.d.ts - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. -*/ - -declare module 'module' { - var mod: { - config: () => any; - id: string; - uri: string; - } - export = mod; -} - -interface RequireError extends Error { - - /** - * The error ID that maps to an ID on a web page. - **/ - requireType: string; - - /** - * Required modules. - **/ - requireModules: string[]; - - /** - * The original error, if there is one (might be null). - **/ - originalError: Error; -} - -interface RequireShim { - - /** - * List of dependencies. - **/ - deps?: string[]; - - /** - * Name the module will be exported as. - **/ - exports?: string; - - /** - * Initialize function with all dependcies passed in, - * if the function returns a value then that value is used - * as the module export value instead of the object - * found via the 'exports' string. - * @param dependencies - * @return - **/ - init?: (...dependencies: any[]) => any; -} - -interface RequireConfig { - - // The root path to use for all module lookups. - baseUrl?: string; - - // Path mappings for module names not found directly under - // baseUrl. - paths?: { [key: string]: any; }; - - - // Dictionary of Shim's. - // does not cover case of key->string[] - shim?: { [key: string]: RequireShim; }; - - /** - * For the given module prefix, instead of loading the - * module with the given ID, substitude a different - * module ID. - * - * @example - * requirejs.config({ - * map: { - * 'some/newmodule': { - * 'foo': 'foo1.2' - * }, - * 'some/oldmodule': { - * 'foo': 'foo1.0' - * } - * } - * }); - **/ - map?: { - [id: string]: { - [id: string]: string; - }; - }; - - /** - * Allows pointing multiple module IDs to a module ID that contains a bundle of modules. - * - * @example - * requirejs.config({ - * bundles: { - * 'primary': ['main', 'util', 'text', 'text!template.html'], - * 'secondary': ['text!secondary.html'] - * } - * }); - **/ - bundles?: { [key: string]: string[]; }; - - /** - * AMD configurations, use module.config() to access in - * define() functions - **/ - config?: { [id: string]: {}; }; - - /** - * Configures loading modules from CommonJS packages. - **/ - packages?: {}; - - /** - * The number of seconds to wait before giving up on loading - * a script. The default is 7 seconds. - **/ - waitSeconds?: number; - - /** - * A name to give to a loading context. This allows require.js - * to load multiple versions of modules in a page, as long as - * each top-level require call specifies a unique context string. - **/ - context?: string; - - /** - * An array of dependencies to load. - **/ - deps?: string[]; - - /** - * A function to pass to require that should be require after - * deps have been loaded. - * @param modules - **/ - callback?: (...modules: any[]) => void; - - /** - * If set to true, an error will be thrown if a script loads - * that does not call define() or have shim exports string - * value that can be checked. - **/ - enforceDefine?: boolean; - - /** - * If set to true, document.createElementNS() will be used - * to create script elements. - **/ - xhtml?: boolean; - - /** - * Extra query string arguments appended to URLs that RequireJS - * uses to fetch resources. Most useful to cache bust when - * the browser or server is not configured correctly. - * - * @example - * urlArgs: "bust= + (new Date()).getTime() - **/ - urlArgs?: string; - - /** - * Specify the value for the type="" attribute used for script - * tags inserted into the document by RequireJS. Default is - * "text/javascript". To use Firefox's JavasScript 1.8 - * features, use "text/javascript;version=1.8". - **/ - scriptType?: string; - - /** - * If set to true, skips the data-main attribute scanning done - * to start module loading. Useful if RequireJS is embedded in - * a utility library that may interact with other RequireJS - * library on the page, and the embedded version should not do - * data-main loading. - **/ - skipDataMain?: boolean; - - /** - * Allow extending requirejs to support Subresource Integrity - * (SRI). - **/ - onNodeCreated?: (node: HTMLScriptElement, config: RequireConfig, moduleName: string, url: string) => void; -} - -// todo: not sure what to do with this guy -interface RequireModule { - - /** - * - **/ - config(): {}; - -} - -/** -* -**/ -interface RequireMap { - - /** - * - **/ - prefix: string; - - /** - * - **/ - name: string; - - /** - * - **/ - parentMap: RequireMap; - - /** - * - **/ - url: string; - - /** - * - **/ - originalName: string; - - /** - * - **/ - fullName: string; -} - -interface Require { - - /** - * Configure require.js - **/ - config(config: RequireConfig): Require; - - /** - * CommonJS require call - * @param module Module to load - * @return The loaded module - */ - (module: string): any; - - /** - * Start the main app logic. - * Callback is optional. - * Can alternatively use deps and callback. - * @param modules Required modules to load. - **/ - (modules: string[]): void; - - /** - * @see Require() - * @param ready Called when required modules are ready. - **/ - (modules: string[], ready: Function): void; - - /** - * @see http://requirejs.org/docs/api.html#errbacks - * @param ready Called when required modules are ready. - **/ - (modules: string[], ready: Function, errback: Function): void; - - /** - * Generate URLs from require module - * @param module Module to URL - * @return URL string - **/ - toUrl(module: string): string; - - /** - * Returns true if the module has already been loaded and defined. - * @param module Module to check - **/ - defined(module: string): boolean; - - /** - * Returns true if the module has already been requested or is in the process of loading and should be available at some point. - * @param module Module to check - **/ - specified(module: string): boolean; - - /** - * On Error override - * @param err - **/ - onError(err: RequireError, errback?: (err: RequireError) => void): void; - - /** - * Undefine a module - * @param module Module to undefine. - **/ - undef(module: string): void; - - /** - * Semi-private function, overload in special instance of undef() - **/ - onResourceLoad(context: Object, map: RequireMap, depArray: RequireMap[]): void; -} - -interface RequireDefine { - - /** - * Define Simple Name/Value Pairs - * @param config Dictionary of Named/Value pairs for the config. - **/ - (config: { [key: string]: any; }): void; - - /** - * Define function. - * @param func: The function module. - **/ - (func: () => any): void; - - /** - * Define function with dependencies. - * @param deps List of dependencies module IDs. - * @param ready Callback function when the dependencies are loaded. - * callback param deps module dependencies - * callback return module definition - **/ - (deps: string[], ready: Function): void; - - /** - * Define module with simplified CommonJS wrapper. - * @param ready - * callback require requirejs instance - * callback exports exports object - * callback module module - * callback return module definition - **/ - (ready: (require: Require, exports: { [key: string]: any; }, module: RequireModule) => any): void; - - /** - * Define a module with a name and dependencies. - * @param name The name of the module. - * @param deps List of dependencies module IDs. - * @param ready Callback function when the dependencies are loaded. - * callback deps module dependencies - * callback return module definition - **/ - (name: string, deps: string[], ready: Function): void; - - /** - * Define a module with a name. - * @param name The name of the module. - * @param ready Callback function when the dependencies are loaded. - * callback return module definition - **/ - (name: string, ready: Function): void; - - /** - * Used to allow a clear indicator that a global define function (as needed for script src browser loading) conforms - * to the AMD API, any global define function SHOULD have a property called "amd" whose value is an object. - * This helps avoid conflict with any other existing JavaScript code that could have defined a define() function - * that does not conform to the AMD API. - * define.amd.jQuery is specific to jQuery and indicates that the loader is able to account for multiple version - * of jQuery being loaded simultaneously. - */ - amd: Object; -} - -// Ambient declarations for 'require' and 'define' -declare var requirejs: Require; -declare var require: Require; -declare var define: RequireDefine; diff --git a/templates/Angular2Spa/typings/tsd.d.ts b/templates/Angular2Spa/typings/tsd.d.ts deleted file mode 100644 index c5cfdc2b..00000000 --- a/templates/Angular2Spa/typings/tsd.d.ts +++ /dev/null @@ -1,3 +0,0 @@ - -/// -/// diff --git a/templates/Angular2Spa/typings/url-workaround.d.ts b/templates/Angular2Spa/typings/url-workaround.d.ts deleted file mode 100644 index 9d167602..00000000 --- a/templates/Angular2Spa/typings/url-workaround.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -// This file is a workaround for angular2-universal-preview version 0.84.2 relying on the declaration of -// Node's 'url' module. Ideally it would not declare dependencies on Node APIs except where it also supplies -// the definitions itself. - -declare module 'url' { - export interface Url {} -} diff --git a/templates/Angular2Spa/web.config b/templates/Angular2Spa/web.config deleted file mode 100644 index a8d66727..00000000 --- a/templates/Angular2Spa/web.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/templates/Angular2Spa/webpack.config.dev.js b/templates/Angular2Spa/webpack.config.dev.js deleted file mode 100644 index 719de1fb..00000000 --- a/templates/Angular2Spa/webpack.config.dev.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - devtool: 'inline-source-map' -}; diff --git a/templates/Angular2Spa/webpack.config.js b/templates/Angular2Spa/webpack.config.js deleted file mode 100644 index bcd7d80a..00000000 --- a/templates/Angular2Spa/webpack.config.js +++ /dev/null @@ -1,36 +0,0 @@ -var path = require('path'); -var webpack = require('webpack'); -var merge = require('extendify')({ isDeep: true, arrays: 'concat' }); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); -var extractCSS = new ExtractTextPlugin('styles.css'); -var devConfig = require('./webpack.config.dev'); -var prodConfig = require('./webpack.config.prod'); -var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; - -module.exports = merge({ - resolve: { - extensions: [ '', '.js', '.ts' ] - }, - module: { - loaders: [ - { test: /\.ts$/, include: /ClientApp/, loader: 'ts-loader' }, - { test: /\.html$/, loader: 'raw-loader' }, - { test: /\.css/, loader: extractCSS.extract(['css']) } - ] - }, - entry: { - main: ['./ClientApp/boot-client.ts'] - }, - output: { - path: path.join(__dirname, 'wwwroot', 'dist'), - filename: '[name].js', - publicPath: '/dist/' - }, - plugins: [ - extractCSS, - new webpack.DllReferencePlugin({ - context: __dirname, - manifest: require('./wwwroot/dist/vendor-manifest.json') - }) - ] -}, isDevelopment ? devConfig : prodConfig); diff --git a/templates/Angular2Spa/webpack.config.prod.js b/templates/Angular2Spa/webpack.config.prod.js deleted file mode 100644 index ddc6cf70..00000000 --- a/templates/Angular2Spa/webpack.config.prod.js +++ /dev/null @@ -1,12 +0,0 @@ -var webpack = require('webpack'); - -module.exports = { - plugins: [ - new webpack.optimize.OccurenceOrderPlugin(), - new webpack.optimize.UglifyJsPlugin({ - compress: { warnings: false }, - minimize: true, - mangle: false // Due to https://github.com/angular/angular/issues/6678 - }) - ] -}; diff --git a/templates/Angular2Spa/webpack.config.vendor.js b/templates/Angular2Spa/webpack.config.vendor.js deleted file mode 100644 index 0fc256ab..00000000 --- a/templates/Angular2Spa/webpack.config.vendor.js +++ /dev/null @@ -1,53 +0,0 @@ -var path = require('path'); -var webpack = require('webpack'); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); -var extractCSS = new ExtractTextPlugin('vendor.css'); -var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; - -module.exports = { - resolve: { - extensions: [ '', '.js' ] - }, - module: { - loaders: [ - { test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }, - { test: /\.css/, loader: extractCSS.extract(['css']) } - ] - }, - entry: { - vendor: [ - 'bootstrap', - 'bootstrap/dist/css/bootstrap.css', - 'style-loader', - 'jquery', - '@angular/common', - '@angular/compiler', - '@angular/core', - '@angular/http', - '@angular/platform-browser', - '@angular/platform-browser-dynamic', - '@angular/router', - '@angular/platform-server', - ] - }, - output: { - path: path.join(__dirname, 'wwwroot', 'dist'), - filename: '[name].js', - library: '[name]_[hash]', - }, - plugins: [ - extractCSS, - new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable) - new webpack.optimize.OccurenceOrderPlugin(), - new webpack.DllPlugin({ - path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'), - name: '[name]_[hash]' - }) - ].concat(isDevelopment ? [] : [ - new webpack.optimize.UglifyJsPlugin({ - compress: { warnings: false }, - minimize: true, - mangle: false // Due to https://github.com/angular/angular/issues/6678 - }) - ]) -}; diff --git a/templates/Angular2Spa/wwwroot/favicon.ico b/templates/Angular2Spa/wwwroot/favicon.ico deleted file mode 100755 index a3a79998..00000000 Binary files a/templates/Angular2Spa/wwwroot/favicon.ico and /dev/null differ diff --git a/templates/Angular2Spa/wwwroot/web.config b/templates/Angular2Spa/wwwroot/web.config deleted file mode 100644 index e70a7778..00000000 --- a/templates/Angular2Spa/wwwroot/web.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/templates/KnockoutSpa/ClientApp/boot.ts b/templates/KnockoutSpa/ClientApp/boot.ts deleted file mode 100644 index 66740eb0..00000000 --- a/templates/KnockoutSpa/ClientApp/boot.ts +++ /dev/null @@ -1,20 +0,0 @@ -import 'bootstrap'; -import 'bootstrap/dist/css/bootstrap.css'; -import './css/site.css'; -import * as ko from 'knockout'; -import { createHistory } from 'history'; -import './webpack-component-loader'; - -// Load and register the component -ko.components.register('app-root', require('./components/app-root/app-root').default); - -// Tell Knockout to start up an instance of your application -ko.applyBindings({ history: createHistory() }); - -// Basic hot reloading support. Automatically reloads and restarts the Knockout app each time -// you modify source files. This will not preserve any application state other than the URL. -declare var module: any; -if (module.hot) { - module.hot.accept(); - module.hot.dispose(() => ko.cleanNode(document.body)); -} diff --git a/templates/KnockoutSpa/ClientApp/components/app-root/app-root.html b/templates/KnockoutSpa/ClientApp/components/app-root/app-root.html deleted file mode 100644 index f1f11b40..00000000 --- a/templates/KnockoutSpa/ClientApp/components/app-root/app-root.html +++ /dev/null @@ -1,8 +0,0 @@ -
    -
    -
    - -
    -
    -
    -
    diff --git a/templates/KnockoutSpa/ClientApp/components/app-root/app-root.ts b/templates/KnockoutSpa/ClientApp/components/app-root/app-root.ts deleted file mode 100644 index 7583faff..00000000 --- a/templates/KnockoutSpa/ClientApp/components/app-root/app-root.ts +++ /dev/null @@ -1,43 +0,0 @@ -import * as ko from 'knockout'; -import { Route, Router } from '../../router'; -import navMenu from '../nav-menu/nav-menu'; - -// Declare the client-side routing configuration -const routes: Route[] = [ - { url: '', params: { page: 'home-page' } }, - { url: 'counter', params: { page: 'counter-example' } }, - { url: 'fetch-data', params: { page: 'fetch-data' } } -]; - -class AppRootViewModel { - public route: KnockoutObservable; - private _router: Router; - - constructor(params: { history: HistoryModule.History }) { - // Activate the client-side router - this._router = new Router(params.history, routes) - this.route = this._router.currentRoute; - - // Load and register all the KO components needed to handle the routes - // The optional 'bundle?lazy!' prefix is a Webpack feature that causes the referenced modules - // to be split into separate files that are then loaded on demand. - // For docs, see https://github.com/webpack/bundle-loader - ko.components.register('nav-menu', navMenu); - ko.components.register('home-page', require('bundle?lazy!../home-page/home-page')); - ko.components.register('counter-example', require('bundle?lazy!../counter-example/counter-example')); - ko.components.register('fetch-data', require('bundle?lazy!../fetch-data/fetch-data')); - } - - // To support hot module replacement, this method unregisters the router and KO components. - // In production scenarios where hot module replacement is disabled, this would not be invoked. - public dispose() { - this._router.dispose(); - - // TODO: Need a better API for this - Object.getOwnPropertyNames((ko).components._allRegisteredComponents).forEach(componentName => { - ko.components.unregister(componentName); - }); - } -} - -export default { viewModel: AppRootViewModel, template: require('./app-root.html') }; diff --git a/templates/KnockoutSpa/ClientApp/components/counter-example/counter-example.html b/templates/KnockoutSpa/ClientApp/components/counter-example/counter-example.html deleted file mode 100644 index 7327e592..00000000 --- a/templates/KnockoutSpa/ClientApp/components/counter-example/counter-example.html +++ /dev/null @@ -1,7 +0,0 @@ -

    Counter

    - -

    This is a simple example of a Knockout component.

    - -

    Current count:

    - - diff --git a/templates/KnockoutSpa/ClientApp/components/counter-example/counter-example.ts b/templates/KnockoutSpa/ClientApp/components/counter-example/counter-example.ts deleted file mode 100644 index 39b7f046..00000000 --- a/templates/KnockoutSpa/ClientApp/components/counter-example/counter-example.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as ko from 'knockout'; - -class CounterExampleViewModel { - public currentCount = ko.observable(0); - - public incrementCounter() { - let prevCount = this.currentCount(); - this.currentCount(prevCount + 1); - } -} - -export default { viewModel: CounterExampleViewModel, template: require('./counter-example.html') }; diff --git a/templates/KnockoutSpa/ClientApp/components/fetch-data/fetch-data.html b/templates/KnockoutSpa/ClientApp/components/fetch-data/fetch-data.html deleted file mode 100644 index 8e9223bb..00000000 --- a/templates/KnockoutSpa/ClientApp/components/fetch-data/fetch-data.html +++ /dev/null @@ -1,24 +0,0 @@ -

    Weather forecast

    - -

    This component demonstrates fetching data from the server.

    - -

    Loading...

    - - - - - - - - - - - - - - - - - - -
    DateTemp. (C)Temp. (F)Summary
    diff --git a/templates/KnockoutSpa/ClientApp/components/fetch-data/fetch-data.ts b/templates/KnockoutSpa/ClientApp/components/fetch-data/fetch-data.ts deleted file mode 100644 index deab0682..00000000 --- a/templates/KnockoutSpa/ClientApp/components/fetch-data/fetch-data.ts +++ /dev/null @@ -1,22 +0,0 @@ -import * as ko from 'knockout'; - -interface WeatherForecast { - dateFormatted: string; - temperatureC: number; - temperatureF: number; - summary: string; -} - -class FetchDataViewModel { - public forecasts = ko.observableArray(); - - constructor() { - fetch('http://github.com/api/SampleData/WeatherForecasts') - .then(response => response.json()) - .then((data: WeatherForecast[]) => { - this.forecasts(data); - }); - } -} - -export default { viewModel: FetchDataViewModel, template: require('./fetch-data.html') }; diff --git a/templates/KnockoutSpa/ClientApp/components/home-page/home-page.html b/templates/KnockoutSpa/ClientApp/components/home-page/home-page.html deleted file mode 100644 index 46242687..00000000 --- a/templates/KnockoutSpa/ClientApp/components/home-page/home-page.html +++ /dev/null @@ -1,16 +0,0 @@ -

    Hello, world!

    -

    Welcome to your new single-page application, built with:

    -
    -

    To help you get started, we've also set up:

    -
      -
    • Client-side navigation. For example, click Counter then Back to return here.
    • -
    • Webpack dev middleware. In development mode, there's no need to run the webpack build tool. Your client-side resources are dynamically built on demand. Updates are available as soon as you modify any file.
    • -
    • Hot module replacement. In development mode, you don't even need to reload the page after making most changes. Within seconds of saving changes to files, your Knockout app will be rebuilt and a new instance injected is into the page.
    • -
    • Code splitting and lazy loading. KO components may optionally be bundled individually and loaded on demand. For example, the code and template for 'Counter' is not loaded until you navigate to it..
    • -
    • Efficient production builds. In production mode, development-time features are disabled, and the webpack build tool produces minified static CSS and JavaScript files.
    • -
    diff --git a/templates/KnockoutSpa/ClientApp/components/home-page/home-page.ts b/templates/KnockoutSpa/ClientApp/components/home-page/home-page.ts deleted file mode 100644 index 588024e2..00000000 --- a/templates/KnockoutSpa/ClientApp/components/home-page/home-page.ts +++ /dev/null @@ -1,6 +0,0 @@ -import * as ko from 'knockout'; - -class HomePageViewModel { -} - -export default { viewModel: HomePageViewModel, template: require('./home-page.html') }; diff --git a/templates/KnockoutSpa/ClientApp/components/nav-menu/nav-menu.html b/templates/KnockoutSpa/ClientApp/components/nav-menu/nav-menu.html deleted file mode 100644 index 0bfd32c9..00000000 --- a/templates/KnockoutSpa/ClientApp/components/nav-menu/nav-menu.html +++ /dev/null @@ -1,33 +0,0 @@ - diff --git a/templates/KnockoutSpa/ClientApp/components/nav-menu/nav-menu.ts b/templates/KnockoutSpa/ClientApp/components/nav-menu/nav-menu.ts deleted file mode 100644 index 186c60e1..00000000 --- a/templates/KnockoutSpa/ClientApp/components/nav-menu/nav-menu.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as ko from 'knockout'; -import { Route } from '../../router'; - -interface NavMenuParams { - route: KnockoutObservable; -} - -class NavMenuViewModel { - public route: KnockoutObservable; - - constructor(params: NavMenuParams) { - // This viewmodel doesn't do anything except pass through the 'route' parameter to the view. - // You could remove this viewmodel entirely, and define 'nav-menu' as a template-only component. - // But in most apps, you'll want some viewmodel logic to determine what navigation options appear. - this.route = params.route; - } -} - -export default { viewModel: NavMenuViewModel, template: require('./nav-menu.html') }; diff --git a/templates/KnockoutSpa/ClientApp/css/site.css b/templates/KnockoutSpa/ClientApp/css/site.css deleted file mode 100755 index 3058af68..00000000 --- a/templates/KnockoutSpa/ClientApp/css/site.css +++ /dev/null @@ -1,66 +0,0 @@ -.main-nav li .glyphicon { - margin-right: 10px; -} - -/* Highlighting rules for nav menu items */ -.main-nav li a.active, -.main-nav li a.active:hover, -.main-nav li a.active:focus { - background-color: #4189C7; - color: white; -} - -/* Keep the nav menu independent of scrolling and on top of other items */ -.main-nav { - position: fixed; - top: 0; - left: 0; - right: 0; - z-index: 1; -} - -@media (max-width: 767px) { - /* On small screens, the nav menu spans the full width of the screen. Leave a space for it. */ - body { - padding-top: 50px; - } -} - -@media (min-width: 768px) { - /* On small screens, convert the nav menu to a vertical sidebar */ - .main-nav { - height: 100%; - width: calc(25% - 20px); - } - .main-nav .navbar { - border-radius: 0px; - border-width: 0px; - height: 100%; - } - .main-nav .navbar-header { - float: none; - } - .main-nav .navbar-collapse { - border-top: 1px solid #444; - padding: 0px; - } - .main-nav .navbar ul { - float: none; - } - .main-nav .navbar li { - float: none; - font-size: 15px; - margin: 6px; - } - .main-nav .navbar li a { - padding: 10px 16px; - border-radius: 4px; - } - .main-nav .navbar a { - /* If a menu item's text is too long, truncate it */ - width: 100%; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } -} diff --git a/templates/KnockoutSpa/ClientApp/router.ts b/templates/KnockoutSpa/ClientApp/router.ts deleted file mode 100644 index 526394e6..00000000 --- a/templates/KnockoutSpa/ClientApp/router.ts +++ /dev/null @@ -1,53 +0,0 @@ -import * as ko from 'knockout'; -import * as crossroads from 'crossroads'; - -// This module configures crossroads.js, a routing library. If you prefer, you -// can use any other routing library (or none at all) as Knockout is designed to -// compose cleanly with external libraries. -// -// You *don't* have to follow the pattern established here (each route entry -// specifies a 'page', which is a Knockout component) - there's nothing built into -// Knockout that requires or even knows about this technique. It's just one of -// many possible ways of setting up client-side routes. -export class Router { - public currentRoute = ko.observable({}); - private disposeHistory: () => void; - private clickEventListener: EventListener; - - constructor(history: HistoryModule.History, routes: Route[]) { - // Reset and configure Crossroads so it matches routes and updates this.currentRoute - crossroads.removeAllRoutes(); - crossroads.resetState(); - crossroads.normalizeFn = crossroads.NORM_AS_OBJECT; - routes.forEach(route => { - crossroads.addRoute(route.url, (requestParams) => { - this.currentRoute(ko.utils.extend(requestParams, route.params)); - }); - }); - - // Make history.js watch for navigation and notify Crossroads - this.disposeHistory = history.listen(location => crossroads.parse(location.pathname)); - this.clickEventListener = evt => { - let target: any = evt.target; - if (target && target.tagName === 'A') { - let href = target.getAttribute('href'); - if (href && href.charAt(0) == '/') { - history.push(href); - evt.preventDefault(); - } - } - }; - - document.addEventListener('click', this.clickEventListener); - } - - public dispose() { - this.disposeHistory(); - document.removeEventListener('click', this.clickEventListener); - } -} - -export interface Route { - url?: string; - params?: any; -} diff --git a/templates/KnockoutSpa/ClientApp/webpack-component-loader.ts b/templates/KnockoutSpa/ClientApp/webpack-component-loader.ts deleted file mode 100644 index 10f13e8f..00000000 --- a/templates/KnockoutSpa/ClientApp/webpack-component-loader.ts +++ /dev/null @@ -1,25 +0,0 @@ -import * as ko from 'knockout'; - -// This Knockout component loader integrates with Webpack's lazy-loaded bundle feature. -// Having this means you can optionally declare components as follows: -// ko.components.register('my-component', require('bundle?lazy!../some-path-to-a-js-or-ts-module')); -// ... and then it will be loaded on demand instead of being loaded up front. -ko.components.loaders.unshift({ - loadComponent: (name, componentConfig, callback) => { - if (typeof componentConfig === 'function') { - // It's a lazy-loaded Webpack bundle - (componentConfig as any)(loadedModule => { - // Handle TypeScript-style default exports - if (loadedModule.__esModule && loadedModule.default) { - loadedModule = loadedModule.default; - } - - // Pass the loaded module to KO's default loader - ko.components.defaultLoader.loadComponent(name, loadedModule, callback); - }); - } else { - // It's something else - let another component loader handle it - callback(null); - } - } -}); diff --git a/templates/KnockoutSpa/Controllers/HomeController.cs b/templates/KnockoutSpa/Controllers/HomeController.cs deleted file mode 100755 index 9d75da88..00000000 --- a/templates/KnockoutSpa/Controllers/HomeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace WebApplicationBasic.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - - public IActionResult Error() - { - return View(); - } - } -} diff --git a/templates/KnockoutSpa/Controllers/SampleDataController.cs b/templates/KnockoutSpa/Controllers/SampleDataController.cs deleted file mode 100644 index 1f46d127..00000000 --- a/templates/KnockoutSpa/Controllers/SampleDataController.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace WebApplicationBasic.Controllers -{ - [Route("api/[controller]")] - public class SampleDataController : Controller - { - private static string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - [HttpGet("[action]")] - public IEnumerable WeatherForecasts() - { - var rng = new Random(); - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - DateFormatted = DateTime.Now.AddDays(index).ToString("d"), - TemperatureC = rng.Next(-20, 55), - Summary = Summaries[rng.Next(Summaries.Length)] - }); - } - - public class WeatherForecast - { - public string DateFormatted { get; set; } - public int TemperatureC { get; set; } - public string Summary { get; set; } - - public int TemperatureF - { - get - { - return 32 + (int)(this.TemperatureC / 0.5556); - } - } - } - } -} diff --git a/templates/KnockoutSpa/Dockerfile b/templates/KnockoutSpa/Dockerfile deleted file mode 100644 index 63d7c456..00000000 --- a/templates/KnockoutSpa/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM microsoft/aspnet:1.0.0-rc1-update1 - -RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list -RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/* - -COPY . /app -WORKDIR /app -RUN ["dnu", "restore"] - -EXPOSE 5000/tcp -ENTRYPOINT ["dnx", "-p", "project.json", "web"] diff --git a/templates/KnockoutSpa/KnockoutSpa.xproj b/templates/KnockoutSpa/KnockoutSpa.xproj deleted file mode 100644 index 7ce39c5c..00000000 --- a/templates/KnockoutSpa/KnockoutSpa.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - true - - - - 85231b41-6998-49ae-abd2-5124c83dbef2 - KnockoutSpa - ..\..\..\JavaScriptServices.sln\artifacts\obj\$(MSBuildProjectName) - ..\..\..\JavaScriptServices.sln\artifacts\bin\$(MSBuildProjectName)\ - - - 2.0 - 2018 - - - diff --git a/templates/KnockoutSpa/README.md b/templates/KnockoutSpa/README.md deleted file mode 100644 index 4e494c9a..00000000 --- a/templates/KnockoutSpa/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Welcome to ASP.NET 5 - -We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. - -You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) - -## This application consists of: - -* Sample pages using ASP.NET MVC 6 -* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side libraries -* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) - -## How to - -* [Add a Controller and View](http://go.microsoft.com/fwlink/?LinkID=398600) -* [Add an appsetting in config and access it in app.](http://go.microsoft.com/fwlink/?LinkID=699562) -* [Manage User Secrets using Secret Manager.](http://go.microsoft.com/fwlink/?LinkId=699315) -* [Use logging to log a message.](http://go.microsoft.com/fwlink/?LinkId=699316) -* [Add packages using NuGet.](http://go.microsoft.com/fwlink/?LinkId=699317) -* [Add client packages using Bower.](http://go.microsoft.com/fwlink/?LinkId=699318) -* [Target development, staging or production environment.](http://go.microsoft.com/fwlink/?LinkId=699319) - -## Overview - -* [Conceptual overview of what is ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518008) -* [Fundamentals of ASP.NET 5 such as Startup and middleware.](http://go.microsoft.com/fwlink/?LinkId=699320) -* [Working with Data](http://go.microsoft.com/fwlink/?LinkId=398602) -* [Security](http://go.microsoft.com/fwlink/?LinkId=398603) -* [Client side development](http://go.microsoft.com/fwlink/?LinkID=699321) -* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=699322) -* [Read more on the documentation site](http://go.microsoft.com/fwlink/?LinkID=699323) - -## Run & Deploy - -* [Run your app](http://go.microsoft.com/fwlink/?LinkID=517851) -* [Run your app on .NET Core](http://go.microsoft.com/fwlink/?LinkID=517852) -* [Run commands in your project.json](http://go.microsoft.com/fwlink/?LinkID=517853) -* [Publish to Microsoft Azure Web Apps](http://go.microsoft.com/fwlink/?LinkID=398609) - -We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/templates/KnockoutSpa/Startup.cs b/templates/KnockoutSpa/Startup.cs deleted file mode 100755 index 0c5cc48c..00000000 --- a/templates/KnockoutSpa/Startup.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.SpaServices.Webpack; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Newtonsoft.Json.Serialization; - -namespace WebApplicationBasic -{ - public class Startup - { - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc().AddJsonOptions(options => - { - options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); - }); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHostingEnvironment env) - { - app.UseDeveloperExceptionPage(); - - if (env.IsDevelopment()) { - app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { - HotModuleReplacement = true - }); - } - - app.UseStaticFiles(); - loggerFactory.AddConsole(); - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - - routes.MapSpaFallbackRoute( - name: "spa-fallback", - defaults: new { controller = "Home", action = "Index" }); - }); - } - - public static void Main(string[] args) - { - var host = new WebHostBuilder() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseKestrel() - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/templates/KnockoutSpa/Views/Home/Index.cshtml b/templates/KnockoutSpa/Views/Home/Index.cshtml deleted file mode 100644 index 866fb01b..00000000 --- a/templates/KnockoutSpa/Views/Home/Index.cshtml +++ /dev/null @@ -1,9 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - - - -@section scripts { - -} diff --git a/templates/KnockoutSpa/Views/Shared/Error.cshtml b/templates/KnockoutSpa/Views/Shared/Error.cshtml deleted file mode 100755 index 473b35d6..00000000 --- a/templates/KnockoutSpa/Views/Shared/Error.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ViewData["Title"] = "Error"; -} - -

    Error.

    -

    An error occurred while processing your request.

    diff --git a/templates/KnockoutSpa/Views/Shared/_Layout.cshtml b/templates/KnockoutSpa/Views/Shared/_Layout.cshtml deleted file mode 100644 index a770ceb4..00000000 --- a/templates/KnockoutSpa/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - @ViewData["Title"] - WebApplicationBasic - - - - - - - - @RenderBody() - - - @RenderSection("scripts", required: false) - - diff --git a/templates/KnockoutSpa/Views/_ViewImports.cshtml b/templates/KnockoutSpa/Views/_ViewImports.cshtml deleted file mode 100755 index e7b4f83f..00000000 --- a/templates/KnockoutSpa/Views/_ViewImports.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@using WebApplicationBasic -@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" -@addTagHelper "*, Microsoft.AspNetCore.SpaServices" diff --git a/templates/KnockoutSpa/Views/_ViewStart.cshtml b/templates/KnockoutSpa/Views/_ViewStart.cshtml deleted file mode 100755 index 820a2f6e..00000000 --- a/templates/KnockoutSpa/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/templates/KnockoutSpa/appsettings.json b/templates/KnockoutSpa/appsettings.json deleted file mode 100755 index e5472e56..00000000 --- a/templates/KnockoutSpa/appsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Verbose", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/templates/KnockoutSpa/package.json b/templates/KnockoutSpa/package.json deleted file mode 100644 index c00f8953..00000000 --- a/templates/KnockoutSpa/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "WebApplicationBasic", - "version": "0.0.0", - "devDependencies": { - "aspnet-webpack": "^1.0.0", - "bootstrap": "^3.3.6", - "bundle-loader": "^0.5.4", - "crossroads": "^0.12.2", - "css-loader": "^0.23.1", - "extendify": "^1.0.0", - "extract-text-webpack-plugin": "^1.0.1", - "file-loader": "^0.8.5", - "history": "^2.0.1", - "jquery": "^2.2.1", - "knockout": "^3.4.0", - "raw-loader": "^0.5.1", - "style-loader": "^0.13.0", - "ts-loader": "^0.8.1", - "typescript": "^1.8.2", - "url-loader": "^0.5.7", - "webpack": "^1.12.14" - }, - "dependencies": { - "webpack-hot-middleware": "^2.10.0" - } -} diff --git a/templates/KnockoutSpa/project.json b/templates/KnockoutSpa/project.json deleted file mode 100755 index 66ff1470..00000000 --- a/templates/KnockoutSpa/project.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.0", - "type": "platform" - }, - "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", - "Microsoft.AspNetCore.SpaServices": "1.0.0-*", - "Microsoft.AspNetCore.Diagnostics": "1.0.0", - "Microsoft.AspNetCore.Mvc": "1.0.0", - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", - "Microsoft.AspNetCore.StaticFiles": "1.0.0", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Logging": "1.0.0", - "Microsoft.Extensions.Logging.Console": "1.0.0", - "Microsoft.Extensions.Logging.Debug": "1.0.0", - "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { - "version": "1.0.0-preview2-final", - "type": "build" - } - }, - - "tools": { - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.AspNetCore.Server.IISIntegration.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.EntityFrameworkCore.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - }, - "Microsoft.Extensions.SecretManager.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - }, - "Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final" - }, - - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "dotnet5.6", - "dnxcore50", - "portable-net45+win8" - ] - } - }, - - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - - "runtimeOptions": { - "configProperties": { - "System.GC.Server": true - } - }, - - "publishOptions": { - "include": [ - "appsettings.json", - "ClientApp", - "node_modules", - "typings", - "Views", - "tsconfig.json", - "tsd.json", - "web.config", - "webpack.*.js", - "wwwroot" - ] - }, - - "scripts": { - "prepublish": [ - "npm install", - "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js", - "node node_modules/webpack/bin/webpack.js" - ], - "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] - }, - - "tooling": { - "defaultNamespace": "WebApplicationBasic" - } -} diff --git a/templates/KnockoutSpa/template_gitignore b/templates/KnockoutSpa/template_gitignore deleted file mode 100644 index d410b8bb..00000000 --- a/templates/KnockoutSpa/template_gitignore +++ /dev/null @@ -1,237 +0,0 @@ -/Properties/launchSettings.json - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -bin/ -Bin/ -obj/ -Obj/ - -# Visual Studio 2015 cache/options directory -.vs/ -/wwwroot/dist/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Microsoft Azure ApplicationInsights config file -ApplicationInsights.config - -# Windows Store app package directory -AppPackages/ -BundleArtifacts/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe - -# FAKE - F# Make -.fake/ diff --git a/templates/KnockoutSpa/tsconfig.json b/templates/KnockoutSpa/tsconfig.json deleted file mode 100644 index 61872e16..00000000 --- a/templates/KnockoutSpa/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "node", - "target": "es5", - "sourceMap": true, - "skipDefaultLibCheck": true - }, - "exclude": [ - "node_modules" - ] -} diff --git a/templates/KnockoutSpa/tsd.json b/templates/KnockoutSpa/tsd.json deleted file mode 100644 index 0e5592c3..00000000 --- a/templates/KnockoutSpa/tsd.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "version": "v4", - "repo": "borisyankov/DefinitelyTyped", - "ref": "master", - "path": "typings", - "bundle": "typings/tsd.d.ts", - "installed": { - "whatwg-fetch/whatwg-fetch.d.ts": { - "commit": "dade4414712ce84e3c63393f1aae407e9e7e6af7" - }, - "knockout/knockout.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "requirejs/require.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "es6-promise/es6-promise.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "history/history.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "react-router/history.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "crossroads/crossroads.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "js-signals/js-signals.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - } - } -} diff --git a/templates/KnockoutSpa/typings/crossroads/crossroads.d.ts b/templates/KnockoutSpa/typings/crossroads/crossroads.d.ts deleted file mode 100644 index 84f69ea4..00000000 --- a/templates/KnockoutSpa/typings/crossroads/crossroads.d.ts +++ /dev/null @@ -1,159 +0,0 @@ -// Type definitions for Crossroads.js -// Project: http://millermedeiros.github.io/crossroads.js/ -// Definitions by: Diullei Gomes -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module CrossroadsJs { - - export interface Route { - matched: Signal; - - /** - * Signal dispatched every time a request "leaves" the route. - */ - switched: Signal; - - /** - * Object used to configure parameters/segments validation rules. - */ - rules: any; - - /** - * If crossroads should try to match this Route even after matching another Route. - */ - greedy: boolean; - - /** - * Remove route from crossroads and destroy it, releasing memory. - */ - dispose(): void; - - /** - * Test if Route matches against request. Return true if request validate against route rules and pattern. - */ - match(request: any): boolean; - - /** - * Return a string that matches the route replacing the capturing groups with the values provided in the replacements object. - */ - interpolate(replacements: any): string; - - /** - * Add a listener to the signal. - * - * @param listener Signal handler function. - * @param listenercontext Context on which listener will be executed (object that should represent the `this` variable inside listener function). - * @param priority The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0) - */ - add(listener: Function, listenerContext?: any, priority?: Number): SignalBinding; - } - - export interface CrossRoadsStatic { - - NORM_AS_ARRAY: Function; - - NORM_AS_OBJECT: Function; - - /** - * Creates a new route pattern listener and add it to crossroads routes collection. - * - * @param pattern String pattern or Regular Expression that should be used to match against requests. - * @param handler Function that should be executed when a request matches the Route pattern. - * @param priority Route execution priority. - */ - addRoute(pattern: any, handler?: Function, priority?: number): Route; - - /** - * Remove a single route from crossroads collection. - * - * @param route Reference to the Route object returned by crossroads.addRoute(). - */ - removeRoute(route: Route): void; - - /** - * Remove all routes from crossroads collection. - */ - removeAllRoutes(): void; - - /** - * Parse a string input and dispatch matched Signal of the first Route that matches the request. - * - * @param request String that should be evaluated and matched against Routes to define which Route handlers should be executed and which parameters should be passed to the handlers. - * @param defaultargs Array containing values passed to matched/routed/bypassed signals as first arguments. Useful for node.js in case you need to access the request and response objects. - */ - parse(request: string, ...defaultArgs: any[]): void; - - /** - * Get number of Routes contained on the crossroads collection. - */ - getNumRoutes(): number; - - /** - * Signal dispatched every time that crossroads.parse can't find a Route that matches the request. Useful for debuging and error handling. - */ - bypassed: Signal; - - /** - * Signal dispatched every time that crossroads.parse find a Route that matches the request. Useful for debuging and for executing tasks that should happen at each routing. - */ - routed: Signal; - - /** - * Create a new independent Router instance. - */ - create(): CrossRoadsStatic; - - /** - * Sets a default function that should be used to normalize parameters before passing them to the Route.matched, works similarly to Route.rules.normalize_. - */ - normalizeFn: Function; - - /** - * Set if crossroads should typecast route paths. Default value is false (IMPORTANT: on v0.5.0 it was true by default). - */ - shouldTypecast: boolean; - - /** - * String representation of the crossroads version number (e.g. "0.6.0"). - */ - VERSION: string; - - /** - * Sets global route matching behavior to greedy so crossroads will try to match every single route with the supplied request (if true it won't stop at first match). - */ - greedy: boolean; - - /** - * Sets if the greedy routes feature is enabled. If false it won't try to match multiple routes (faster). - */ - greedyEnabled: boolean; - - /** - * Resets the Router internal state. Will clear reference to previously matched routes (so they won't dispatch switched signal when matching a new route) and reset last request. - */ - resetState(): void; - - /** - * Sets if Router should care about previous state, so multiple crossroads.parse() calls passing same argument would not trigger the routed, matched and bypassed signals. - */ - ignoreState: boolean; - - /** - * Pipe routers, so all crossroads.parse() calls will be forwarded to the other router as well. - */ - pipe(router: CrossRoadsStatic): void; - - /** - * "Ceci n'est pas une pipe" - */ - unpipe(router: CrossRoadsStatic): void; - } -} - -declare var crossroads: CrossroadsJs.CrossRoadsStatic; - -declare module 'crossroads'{ - export = crossroads; -} diff --git a/templates/KnockoutSpa/typings/es6-promise/es6-promise.d.ts b/templates/KnockoutSpa/typings/es6-promise/es6-promise.d.ts deleted file mode 100644 index d5fdc2db..00000000 --- a/templates/KnockoutSpa/typings/es6-promise/es6-promise.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -// Type definitions for es6-promise -// Project: https://github.com/jakearchibald/ES6-Promise -// Definitions by: François de Campredon , vvakame -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -interface Thenable { - then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; - then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => void): Thenable; - catch(onRejected?: (error: any) => U | Thenable): Thenable; -} - -declare class Promise implements Thenable { - /** - * If you call resolve in the body of the callback passed to the constructor, - * your promise is fulfilled with result object passed to resolve. - * If you call reject your promise is rejected with the object passed to reject. - * For consistency and debugging (eg stack traces), obj should be an instanceof Error. - * Any errors thrown in the constructor callback will be implicitly passed to reject(). - */ - constructor(callback: (resolve : (value?: T | Thenable) => void, reject: (error?: any) => void) => void); - - /** - * onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. - * Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called. - * Both callbacks have a single parameter , the fulfillment value or rejection reason. - * "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve. - * If an error is thrown in the callback, the returned promise rejects with that error. - * - * @param onFulfilled called when/if "promise" resolves - * @param onRejected called when/if "promise" rejects - */ - then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => U | Thenable): Promise; - then(onFulfilled?: (value: T) => U | Thenable, onRejected?: (error: any) => void): Promise; - - /** - * Sugar for promise.then(undefined, onRejected) - * - * @param onRejected called when/if "promise" rejects - */ - catch(onRejected?: (error: any) => U | Thenable): Promise; -} - -declare module Promise { - /** - * Make a new promise from the thenable. - * A thenable is promise-like in as far as it has a "then" method. - */ - function resolve(value?: T | Thenable): Promise; - - /** - * Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error - */ - function reject(error: any): Promise; - function reject(error: T): Promise; - - /** - * Make a promise that fulfills when every item in the array fulfills, and rejects if (and when) any item rejects. - * the array passed to all can be a mixture of promise-like objects and other objects. - * The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value. - */ - function all(promises: (T | Thenable)[]): Promise; - - /** - * Make a Promise that fulfills when any item fulfills, and rejects if any item rejects. - */ - function race(promises: (T | Thenable)[]): Promise; -} - -declare module 'es6-promise' { - var foo: typeof Promise; // Temp variable to reference Promise in local context - module rsvp { - export var Promise: typeof foo; - } - export = rsvp; -} diff --git a/templates/KnockoutSpa/typings/history/history.d.ts b/templates/KnockoutSpa/typings/history/history.d.ts deleted file mode 100644 index 21b556ae..00000000 --- a/templates/KnockoutSpa/typings/history/history.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Type definitions for History.js 1.8.0 -// Project: https://github.com/browserstate/history.js -// Definitions by: Boris Yankov , Gidon Junge -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -interface HistoryAdapter { - bind(element: any, event: string, callback: () => void): void; - trigger(element: any, event: string): void; - onDomLoad(callback: () => void): void; -} - -// Since History is defined in lib.d.ts as well -// the name for our interfaces was chosen to be Historyjs -// However at runtime you would need to do -// https://github.com/borisyankov/DefinitelyTyped/issues/277 -// var Historyjs: Historyjs = History; - -interface Historyjs { - - enabled: boolean; - - pushState(data: any, title: string, url: string): void; - replaceState(data: any, title: string, url: string): void; - getState(): HistoryState; - getStateByIndex(index: number): HistoryState; - getCurrentIndex(): number; - getHash(): string; - - Adapter: HistoryAdapter; - - back(): void; - forward(): void; - go(x: Number): void; - - log(...messages: any[]): void; - debug(...messages: any[]): void; - - options: HistoryOptions; -} - -interface HistoryState { - data?: any; - title?: string; - url: string; -} - -interface HistoryOptions { - hashChangeInterval?: number; - safariPollInterval?: number; - doubleCheckInterval?: number; - disableSuid?: boolean; - storeInterval?: number; - busyDelay?: number; - debug?: boolean; - initialTitle?: string; - html4Mode?: boolean; - delayInit?: number; - - -} diff --git a/templates/KnockoutSpa/typings/js-signals/js-signals.d.ts b/templates/KnockoutSpa/typings/js-signals/js-signals.d.ts deleted file mode 100644 index c396bf49..00000000 --- a/templates/KnockoutSpa/typings/js-signals/js-signals.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -// Type definitions for JS-Signals -// Project: http://millermedeiros.github.io/js-signals/ -// Definitions by: Diullei Gomes -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare var signals: SignalWrapper; - -declare module "signals" { - export = signals; -} - -interface SignalWrapper { - Signal: Signal -} - -interface SignalBinding { - active: boolean; - context: any; - params: any; - detach(): Function; - execute(paramsArr?:any[]): any; - getListener(): Function; - getSignal(): Signal; - isBound(): boolean; - isOnce(): boolean; -} - -interface Signal { - /** - * Custom event broadcaster - *
    - inspired by Robert Penner's AS3 Signals. - * @name Signal - * @author Miller Medeiros - * @constructor - */ - new(): Signal; - - /** - * If Signal is active and should broadcast events. - */ - active: boolean; - - /** - * If Signal should keep record of previously dispatched parameters and automatically - * execute listener during add()/addOnce() if Signal was already dispatched before. - */ - memorize: boolean; - - /** - * Signals Version Number - */ - VERSION: string; - - /** - * Add a listener to the signal. - * - * @param listener Signal handler function. - * @param listenercontext Context on which listener will be executed (object that should represent the `this` variable inside listener function). - * @param priority The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0) - */ - add(listener: Function, listenerContext?: any, priority?: Number): SignalBinding; - - /** - * Add listener to the signal that should be removed after first execution (will be executed only once). - * - * @param listener Signal handler function. - * @param listenercontext Context on which listener will be executed (object that should represent the `this` variable inside listener function). - * @param priority The priority level of the event listener. Listeners with higher priority will be executed before listeners with lower priority. Listeners with same priority level will be executed at the same order as they were added. (default = 0) - */ - addOnce(listener: Function, listenerContext?: any, priority?: Number): SignalBinding; - - /** - * Dispatch/Broadcast Signal to all listeners added to the queue. - * - * @param params Parameters that should be passed to each handler. - */ - dispatch(...params: any[]): void; - - /** - * Remove all bindings from signal and destroy any reference to external objects (destroy Signal object). - */ - dispose(): void; - - /** - * Forget memorized arguments. - */ - forget(): void; - - /** - * Returns a number of listeners attached to the Signal. - */ - getNumListeners(): number; - - /** - * Stop propagation of the event, blocking the dispatch to next listeners on the queue. - */ - halt(): void; - - /** - * Check if listener was attached to Signal. - */ - has(listener: Function, context?: any): boolean; - - /** - * Remove a single listener from the dispatch queue. - */ - remove(listener: Function, context?: any): Function; - - removeAll(): void; -} diff --git a/templates/KnockoutSpa/typings/knockout/knockout.d.ts b/templates/KnockoutSpa/typings/knockout/knockout.d.ts deleted file mode 100644 index 8ccbaa75..00000000 --- a/templates/KnockoutSpa/typings/knockout/knockout.d.ts +++ /dev/null @@ -1,631 +0,0 @@ -// Type definitions for Knockout v3.2.0 -// Project: http://knockoutjs.com -// Definitions by: Boris Yankov , Igor Oleinikov , Clément Bourgeois -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -interface KnockoutSubscribableFunctions { - [key: string]: KnockoutBindingHandler; - - notifySubscribers(valueToWrite?: T, event?: string): void; -} - -interface KnockoutComputedFunctions { - [key: string]: KnockoutBindingHandler; -} - -interface KnockoutObservableFunctions { - [key: string]: KnockoutBindingHandler; - - equalityComparer(a: any, b: any): boolean; -} - -interface KnockoutObservableArrayFunctions { - // General Array functions - indexOf(searchElement: T, fromIndex?: number): number; - slice(start: number, end?: number): T[]; - splice(start: number): T[]; - splice(start: number, deleteCount: number, ...items: T[]): T[]; - pop(): T; - push(...items: T[]): void; - shift(): T; - unshift(...items: T[]): number; - reverse(): KnockoutObservableArray; - sort(): KnockoutObservableArray; - sort(compareFunction: (left: T, right: T) => number): KnockoutObservableArray; - - // Ko specific - [key: string]: KnockoutBindingHandler; - - replace(oldItem: T, newItem: T): void; - - remove(item: T): T[]; - remove(removeFunction: (item: T) => boolean): T[]; - removeAll(items: T[]): T[]; - removeAll(): T[]; - - destroy(item: T): void; - destroy(destroyFunction: (item: T) => boolean): void; - destroyAll(items: T[]): void; - destroyAll(): void; -} - -interface KnockoutSubscribableStatic { - fn: KnockoutSubscribableFunctions; - - new (): KnockoutSubscribable; -} - -interface KnockoutSubscription { - dispose(): void; -} - -interface KnockoutSubscribable extends KnockoutSubscribableFunctions { - subscribe(callback: (newValue: T) => void, target?: any, event?: string): KnockoutSubscription; - subscribe(callback: (newValue: TEvent) => void, target: any, event: string): KnockoutSubscription; - extend(requestedExtenders: { [key: string]: any; }): KnockoutSubscribable; - getSubscriptionsCount(): number; -} - -interface KnockoutComputedStatic { - fn: KnockoutComputedFunctions; - - (): KnockoutComputed; - (func: () => T, context?: any, options?: any): KnockoutComputed; - (def: KnockoutComputedDefine, context?: any): KnockoutComputed; -} - -interface KnockoutComputed extends KnockoutObservable, KnockoutComputedFunctions { - fn: KnockoutComputedFunctions; - - dispose(): void; - isActive(): boolean; - getDependenciesCount(): number; - extend(requestedExtenders: { [key: string]: any; }): KnockoutComputed; -} - -interface KnockoutObservableArrayStatic { - fn: KnockoutObservableArrayFunctions; - - (value?: T[]): KnockoutObservableArray; -} - -interface KnockoutObservableArray extends KnockoutObservable, KnockoutObservableArrayFunctions { - extend(requestedExtenders: { [key: string]: any; }): KnockoutObservableArray; -} - -interface KnockoutObservableStatic { - fn: KnockoutObservableFunctions; - - (value?: T): KnockoutObservable; -} - -interface KnockoutObservable extends KnockoutSubscribable, KnockoutObservableFunctions { - (): T; - (value: T): void; - - peek(): T; - valueHasMutated?:{(): void;}; - valueWillMutate?:{(): void;}; - extend(requestedExtenders: { [key: string]: any; }): KnockoutObservable; -} - -interface KnockoutComputedDefine { - read(): T; - write? (value: T): void; - disposeWhenNodeIsRemoved?: Node; - disposeWhen? (): boolean; - owner?: any; - deferEvaluation?: boolean; - pure?: boolean; -} - -interface KnockoutBindingContext { - $parent: any; - $parents: any[]; - $root: any; - $data: any; - $rawData: any | KnockoutObservable; - $index?: KnockoutObservable; - $parentContext?: KnockoutBindingContext; - $component: any; - $componentTemplateNodes: Node[]; - - extend(properties: any): any; - createChildContext(dataItemOrAccessor: any, dataItemAlias?: any, extendCallback?: Function): any; -} - -interface KnockoutAllBindingsAccessor { - (): any; - get(name: string): any; - has(name: string): boolean; -} - -interface KnockoutBindingHandler { - after?: Array; - init?: (element: any, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor, viewModel?: any, bindingContext?: KnockoutBindingContext) => void | { controlsDescendantBindings: boolean; }; - update?: (element: any, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor, viewModel?: any, bindingContext?: KnockoutBindingContext) => void; - options?: any; - preprocess?: (value: string, name: string, addBindingCallback?: (name: string, value: string) => void) => string; -} - -interface KnockoutBindingHandlers { - [bindingHandler: string]: KnockoutBindingHandler; - - // Controlling text and appearance - visible: KnockoutBindingHandler; - text: KnockoutBindingHandler; - html: KnockoutBindingHandler; - css: KnockoutBindingHandler; - style: KnockoutBindingHandler; - attr: KnockoutBindingHandler; - - // Control Flow - foreach: KnockoutBindingHandler; - if: KnockoutBindingHandler; - ifnot: KnockoutBindingHandler; - with: KnockoutBindingHandler; - - // Working with form fields - click: KnockoutBindingHandler; - event: KnockoutBindingHandler; - submit: KnockoutBindingHandler; - enable: KnockoutBindingHandler; - disable: KnockoutBindingHandler; - value: KnockoutBindingHandler; - textInput: KnockoutBindingHandler; - hasfocus: KnockoutBindingHandler; - checked: KnockoutBindingHandler; - options: KnockoutBindingHandler; - selectedOptions: KnockoutBindingHandler; - uniqueName: KnockoutBindingHandler; - - // Rendering templates - template: KnockoutBindingHandler; - - // Components (new for v3.2) - component: KnockoutBindingHandler; -} - -interface KnockoutMemoization { - memoize(callback: () => string): string; - unmemoize(memoId: string, callbackParams: any[]): boolean; - unmemoizeDomNodeAndDescendants(domNode: any, extraCallbackParamsArray: any[]): boolean; - parseMemoText(memoText: string): string; -} - -interface KnockoutVirtualElement {} - -interface KnockoutVirtualElements { - allowedBindings: { [bindingName: string]: boolean; }; - emptyNode(node: KnockoutVirtualElement ): void; - firstChild(node: KnockoutVirtualElement ): KnockoutVirtualElement; - insertAfter( container: KnockoutVirtualElement, nodeToInsert: Node, insertAfter: Node ): void; - nextSibling(node: KnockoutVirtualElement): Node; - prepend(node: KnockoutVirtualElement, toInsert: Node ): void; - setDomNodeChildren(node: KnockoutVirtualElement, newChildren: { length: number;[index: number]: Node; } ): void; - childNodes(node: KnockoutVirtualElement ): Node[]; -} - -interface KnockoutExtenders { - throttle(target: any, timeout: number): KnockoutComputed; - notify(target: any, notifyWhen: string): any; - - rateLimit(target: any, timeout: number): any; - rateLimit(target: any, options: { timeout: number; method?: string; }): any; - - trackArrayChanges(target: any): any; -} - -// -// NOTE TO MAINTAINERS AND CONTRIBUTORS : pay attention to only include symbols that are -// publicly exported in the minified version of ko, without that you can give the false -// impression that some functions will be available in production builds. -// -interface KnockoutUtils { - ////////////////////////////////// - // utils.domData.js - ////////////////////////////////// - - domData: { - get (node: Element, key: string): any; - - set (node: Element, key: string, value: any): void; - - getAll(node: Element, createIfNotFound: boolean): any; - - clear(node: Element): boolean; - }; - - ////////////////////////////////// - // utils.domNodeDisposal.js - ////////////////////////////////// - - domNodeDisposal: { - addDisposeCallback(node: Element, callback: Function): void; - - removeDisposeCallback(node: Element, callback: Function): void; - - cleanNode(node: Node): Element; - - removeNode(node: Node): void; - }; - - addOrRemoveItem(array: T[] | KnockoutObservable, value: T, included: T): void; - - arrayFilter(array: T[], predicate: (item: T) => boolean): T[]; - - arrayFirst(array: T[], predicate: (item: T) => boolean, predicateOwner?: any): T; - - arrayForEach(array: T[], action: (item: T, index: number) => void): void; - - arrayGetDistinctValues(array: T[]): T[]; - - arrayIndexOf(array: T[], item: T): number; - - arrayMap(array: T[], mapping: (item: T) => U): U[]; - - arrayPushAll(array: T[] | KnockoutObservableArray, valuesToPush: T[]): T[]; - - arrayRemoveItem(array: any[], itemToRemove: any): void; - - compareArrays(a: T[], b: T[]): Array>; - - extend(target: Object, source: Object): Object; - - fieldsIncludedWithJsonPost: any[]; - - getFormFields(form: any, fieldName: string): any[]; - - objectForEach(obj: any, action: (key: any, value: any) => void): void; - - parseHtmlFragment(html: string): any[]; - - parseJson(jsonString: string): any; - - postJson(urlOrForm: any, data: any, options: any): void; - - peekObservable(value: KnockoutObservable): T; - - range(min: any, max: any): any; - - registerEventHandler(element: any, eventType: any, handler: Function): void; - - setHtml(node: Element, html: () => string): void; - - setHtml(node: Element, html: string): void; - - setTextContent(element: any, textContent: string | KnockoutObservable): void; - - stringifyJson(data: any, replacer?: Function, space?: string): string; - - toggleDomNodeCssClass(node: any, className: string, shouldHaveClass: boolean): void; - - triggerEvent(element: any, eventType: any): void; - - unwrapObservable(value: KnockoutObservable | T): T; - - // NOT PART OF THE MINIFIED API SURFACE (ONLY IN knockout-{version}.debug.js) https://github.com/SteveSanderson/knockout/issues/670 - // forceRefresh(node: any): void; - // ieVersion: number; - // isIe6: boolean; - // isIe7: boolean; - // jQueryHtmlParse(html: string): any[]; - // makeArray(arrayLikeObject: any): any[]; - // moveCleanedNodesToContainerElement(nodes: any[]): HTMLElement; - // replaceDomNodes(nodeToReplaceOrNodeArray: any, newNodesArray: any[]): void; - // setDomNodeChildren(domNode: any, childNodes: any[]): void; - // setElementName(element: any, name: string): void; - // setOptionNodeSelectionState(optionNode: any, isSelected: boolean): void; - // simpleHtmlParse(html: string): any[]; - // stringStartsWith(str: string, startsWith: string): boolean; - // stringTokenize(str: string, delimiter: string): string[]; - // stringTrim(str: string): string; - // tagNameLower(element: any): string; -} - -interface KnockoutArrayChange { - status: string; - value: T; - index: number; - moved?: number; -} - -////////////////////////////////// -// templateSources.js -////////////////////////////////// - -interface KnockoutTemplateSourcesDomElement { - text(): any; - text(value: any): void; - - data(key: string): any; - data(key: string, value: any): any; -} - -interface KnockoutTemplateAnonymous extends KnockoutTemplateSourcesDomElement { - nodes(): any; - nodes(value: any): void; -} - -interface KnockoutTemplateSources { - - domElement: { - prototype: KnockoutTemplateSourcesDomElement - new (element: Element): KnockoutTemplateSourcesDomElement - }; - - anonymousTemplate: { - prototype: KnockoutTemplateAnonymous; - new (element: Element): KnockoutTemplateAnonymous; - }; -} - -////////////////////////////////// -// nativeTemplateEngine.js -////////////////////////////////// - -interface KnockoutNativeTemplateEngine { - - renderTemplateSource(templateSource: Object, bindingContext?: KnockoutBindingContext, options?: Object): any[]; -} - -////////////////////////////////// -// templateEngine.js -////////////////////////////////// - -interface KnockoutTemplateEngine extends KnockoutNativeTemplateEngine { - - createJavaScriptEvaluatorBlock(script: string): string; - - makeTemplateSource(template: any, templateDocument?: Document): any; - - renderTemplate(template: any, bindingContext: KnockoutBindingContext, options: Object, templateDocument: Document): any; - - isTemplateRewritten(template: any, templateDocument: Document): boolean; - - rewriteTemplate(template: any, rewriterCallback: Function, templateDocument: Document): void; -} - -///////////////////////////////// - -interface KnockoutStatic { - utils: KnockoutUtils; - memoization: KnockoutMemoization; - - bindingHandlers: KnockoutBindingHandlers; - getBindingHandler(handler: string): KnockoutBindingHandler; - - virtualElements: KnockoutVirtualElements; - extenders: KnockoutExtenders; - - applyBindings(viewModelOrBindingContext?: any, rootNode?: any): void; - applyBindingsToDescendants(viewModelOrBindingContext: any, rootNode: any): void; - applyBindingAccessorsToNode(node: Node, bindings: (bindingContext: KnockoutBindingContext, node: Node) => {}, bindingContext: KnockoutBindingContext): void; - applyBindingAccessorsToNode(node: Node, bindings: {}, bindingContext: KnockoutBindingContext): void; - applyBindingAccessorsToNode(node: Node, bindings: (bindingContext: KnockoutBindingContext, node: Node) => {}, viewModel: any): void; - applyBindingAccessorsToNode(node: Node, bindings: {}, viewModel: any): void; - applyBindingsToNode(node: Node, bindings: any, viewModelOrBindingContext?: any): any; - - subscribable: KnockoutSubscribableStatic; - observable: KnockoutObservableStatic; - - computed: KnockoutComputedStatic; - pureComputed(evaluatorFunction: () => T, context?: any): KnockoutComputed; - pureComputed(options: KnockoutComputedDefine, context?: any): KnockoutComputed; - - observableArray: KnockoutObservableArrayStatic; - - contextFor(node: any): any; - isSubscribable(instance: any): boolean; - toJSON(viewModel: any, replacer?: Function, space?: any): string; - toJS(viewModel: any): any; - isObservable(instance: any): boolean; - isWriteableObservable(instance: any): boolean; - isComputed(instance: any): boolean; - dataFor(node: any): any; - removeNode(node: Element): void; - cleanNode(node: Element): Element; - renderTemplate(template: Function, viewModel: any, options?: any, target?: any, renderMode?: any): any; - renderTemplate(template: string, viewModel: any, options?: any, target?: any, renderMode?: any): any; - unwrap(value: KnockoutObservable | T): T; - - computedContext: KnockoutComputedContext; - - ////////////////////////////////// - // templateSources.js - ////////////////////////////////// - - templateSources: KnockoutTemplateSources; - - ////////////////////////////////// - // templateEngine.js - ////////////////////////////////// - - templateEngine: { - - prototype: KnockoutTemplateEngine; - - new (): KnockoutTemplateEngine; - }; - - ////////////////////////////////// - // templateRewriting.js - ////////////////////////////////// - - templateRewriting: { - - ensureTemplateIsRewritten(template: Node, templateEngine: KnockoutTemplateEngine, templateDocument: Document): any; - ensureTemplateIsRewritten(template: string, templateEngine: KnockoutTemplateEngine, templateDocument: Document): any; - - memoizeBindingAttributeSyntax(htmlString: string, templateEngine: KnockoutTemplateEngine): any; - - applyMemoizedBindingsToNextSibling(bindings: any, nodeName: string): string; - }; - - ////////////////////////////////// - // nativeTemplateEngine.js - ////////////////////////////////// - - nativeTemplateEngine: { - - prototype: KnockoutNativeTemplateEngine; - - new (): KnockoutNativeTemplateEngine; - - instance: KnockoutNativeTemplateEngine; - }; - - ////////////////////////////////// - // jqueryTmplTemplateEngine.js - ////////////////////////////////// - - jqueryTmplTemplateEngine: { - - prototype: KnockoutTemplateEngine; - - renderTemplateSource(templateSource: Object, bindingContext: KnockoutBindingContext, options: Object): Node[]; - - createJavaScriptEvaluatorBlock(script: string): string; - - addTemplate(templateName: string, templateMarkup: string): void; - }; - - ////////////////////////////////// - // templating.js - ////////////////////////////////// - - setTemplateEngine(templateEngine: KnockoutNativeTemplateEngine): void; - - renderTemplate(template: Function, dataOrBindingContext: KnockoutBindingContext, options: Object, targetNodeOrNodeArray: Node, renderMode: string): any; - renderTemplate(template: any, dataOrBindingContext: KnockoutBindingContext, options: Object, targetNodeOrNodeArray: Node, renderMode: string): any; - renderTemplate(template: Function, dataOrBindingContext: any, options: Object, targetNodeOrNodeArray: Node, renderMode: string): any; - renderTemplate(template: any, dataOrBindingContext: any, options: Object, targetNodeOrNodeArray: Node, renderMode: string): any; - renderTemplate(template: Function, dataOrBindingContext: KnockoutBindingContext, options: Object, targetNodeOrNodeArray: Node[], renderMode: string): any; - renderTemplate(template: any, dataOrBindingContext: KnockoutBindingContext, options: Object, targetNodeOrNodeArray: Node[], renderMode: string): any; - renderTemplate(template: Function, dataOrBindingContext: any, options: Object, targetNodeOrNodeArray: Node[], renderMode: string): any; - renderTemplate(template: any, dataOrBindingContext: any, options: Object, targetNodeOrNodeArray: Node[], renderMode: string): any; - - renderTemplateForEach(template: Function, arrayOrObservableArray: any[], options: Object, targetNode: Node, parentBindingContext: KnockoutBindingContext): any; - renderTemplateForEach(template: any, arrayOrObservableArray: any[], options: Object, targetNode: Node, parentBindingContext: KnockoutBindingContext): any; - renderTemplateForEach(template: Function, arrayOrObservableArray: KnockoutObservable, options: Object, targetNode: Node, parentBindingContext: KnockoutBindingContext): any; - renderTemplateForEach(template: any, arrayOrObservableArray: KnockoutObservable, options: Object, targetNode: Node, parentBindingContext: KnockoutBindingContext): any; - - expressionRewriting: { - bindingRewriteValidators: any; - parseObjectLiteral: { (objectLiteralString: string): any[] } - }; - - ///////////////////////////////// - - bindingProvider: { - instance: KnockoutBindingProvider; - new (): KnockoutBindingProvider; - } - - ///////////////////////////////// - // selectExtensions.js - ///////////////////////////////// - - selectExtensions: { - - readValue(element: HTMLElement): any; - - writeValue(element: HTMLElement, value: any): void; - }; - - components: KnockoutComponents; -} - -interface KnockoutBindingProvider { - nodeHasBindings(node: Node): boolean; - getBindings(node: Node, bindingContext: KnockoutBindingContext): {}; - getBindingAccessors?(node: Node, bindingContext: KnockoutBindingContext): { [key: string]: string; }; -} - -interface KnockoutComputedContext { - getDependenciesCount(): number; - isInitial: () => boolean; - isSleeping: boolean; -} - -// -// refactored types into a namespace to reduce global pollution -// and used Union Types to simplify overloads (requires TypeScript 1.4) -// -declare module KnockoutComponentTypes { - - interface Config { - viewModel?: ViewModelFunction | ViewModelSharedInstance | ViewModelFactoryFunction | AMDModule; - template: string | Node[]| DocumentFragment | TemplateElement | AMDModule; - synchronous?: boolean; - } - - interface ComponentConfig { - viewModel?: ViewModelFunction | ViewModelSharedInstance | ViewModelFactoryFunction | AMDModule; - template: any; - createViewModel?: any; - } - - interface EmptyConfig { - } - - // common AMD type - interface AMDModule { - require: string; - } - - // viewmodel types - interface ViewModelFunction { - (params?: any): any; - } - - interface ViewModelSharedInstance { - instance: any; - } - - interface ViewModelFactoryFunction { - createViewModel: (params?: any, componentInfo?: ComponentInfo) => any; - } - - interface ComponentInfo { - element: Node; - templateNodes: Node[]; - } - - interface TemplateElement { - element: string | Node; - } - - interface Loader { - getConfig? (componentName: string, callback: (result: ComponentConfig) => void): void; - loadComponent? (componentName: string, config: ComponentConfig, callback: (result: Definition) => void): void; - loadTemplate? (componentName: string, templateConfig: any, callback: (result: Node[]) => void): void; - loadViewModel? (componentName: string, viewModelConfig: any, callback: (result: any) => void): void; - suppressLoaderExceptions?: boolean; - } - - interface Definition { - template: Node[]; - createViewModel? (params: any, options: { element: Node; }): any; - } -} - -interface KnockoutComponents { - // overloads for register method: - register(componentName: string, config: KnockoutComponentTypes.Config | KnockoutComponentTypes.EmptyConfig): void; - - isRegistered(componentName: string): boolean; - unregister(componentName: string): void; - get(componentName: string, callback: (definition: KnockoutComponentTypes.Definition) => void): void; - clearCachedDefinition(componentName: string): void - defaultLoader: KnockoutComponentTypes.Loader; - loaders: KnockoutComponentTypes.Loader[]; - getComponentNameForNode(node: Node): string; -} - -declare var ko: KnockoutStatic; - -declare module "knockout" { - export = ko; -} diff --git a/templates/KnockoutSpa/typings/react-router/history.d.ts b/templates/KnockoutSpa/typings/react-router/history.d.ts deleted file mode 100644 index e22dbb75..00000000 --- a/templates/KnockoutSpa/typings/react-router/history.d.ts +++ /dev/null @@ -1,233 +0,0 @@ -// Type definitions for history v2.0.0 -// Project: https://github.com/rackt/history -// Definitions by: Sergey Buturlakin , Nathan Brown -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -declare namespace HistoryModule { - - // types based on https://github.com/rackt/history/blob/master/docs/Terms.md - - type Action = string - - type BeforeUnloadHook = () => string | boolean - - type CreateHistory = (options?: HistoryOptions) => T - - type CreateHistoryEnhancer = (createHistory: CreateHistory) => CreateHistory - - interface History { - listenBefore(hook: TransitionHook): () => void - listen(listener: LocationListener): () => void - transitionTo(location: Location): void - push(path: LocationDescriptor): void - replace(path: LocationDescriptor): void - go(n: number): void - goBack(): void - goForward(): void - createKey(): LocationKey - createPath(path: LocationDescriptor): Path - createHref(path: LocationDescriptor): Href - createLocation(path?: LocationDescriptor, action?: Action, key?: LocationKey): Location - - /** @deprecated use a location descriptor instead */ - createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location - /** @deprecated use location.key to save state instead */ - pushState(state: LocationState, path: Path): void - /** @deprecated use location.key to save state instead */ - replaceState(state: LocationState, path: Path): void - /** @deprecated use location.key to save state instead */ - setState(state: LocationState): void - /** @deprecated use listenBefore instead */ - registerTransitionHook(hook: TransitionHook): void - /** @deprecated use the callback returned from listenBefore instead */ - unregisterTransitionHook(hook: TransitionHook): void - } - - type HistoryOptions = { - getCurrentLocation?: () => Location - finishTransition?: (nextLocation: Location) => boolean - saveState?: (key: LocationKey, state: LocationState) => void - go?: (n: number) => void - getUserConfirmation?: (message: string, callback: (result: boolean) => void) => void - keyLength?: number - queryKey?: string | boolean - stringifyQuery?: (obj: any) => string - parseQueryString?: (str: string) => any - basename?: string - entries?: string | [any] - current?: number - } - - type Href = string - - type Location = { - pathname: Pathname - search: Search - query: Query - state: LocationState - action: Action - key: LocationKey - basename?: string - } - - type LocationDescriptorObject = { - pathname?: Pathname - search?: Search - query?: Query - state?: LocationState - } - - type LocationDescriptor = LocationDescriptorObject | Path - - type LocationKey = string - - type LocationListener = (location: Location) => void - - type LocationState = Object - - type Path = string // Pathname + QueryString - - type Pathname = string - - type Query = Object - - type QueryString = string - - type Search = string - - type TransitionHook = (location: Location, callback: (result: any) => void) => any - - - interface HistoryBeforeUnload { - listenBeforeUnload(hook: BeforeUnloadHook): () => void - } - - interface HistoryQueries { - pushState(state: LocationState, pathname: Pathname | Path, query?: Query): void - replaceState(state: LocationState, pathname: Pathname | Path, query?: Query): void - createPath(path: Path, query?: Query): Path - createHref(path: Path, query?: Query): Href - } - - - // Global usage, without modules, needs the small trick, because lib.d.ts - // already has `history` and `History` global definitions: - // var createHistory = ((window as any).History as HistoryModule.Module).createHistory; - interface Module { - createHistory: CreateHistory - createHashHistory: CreateHistory - createMemoryHistory: CreateHistory - createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location - useBasename(createHistory: CreateHistory): CreateHistory - useBeforeUnload(createHistory: CreateHistory): CreateHistory - useQueries(createHistory: CreateHistory): CreateHistory - actions: { - PUSH: string - REPLACE: string - POP: string - } - } - -} - - -declare module "history/lib/createBrowserHistory" { - - export default function createBrowserHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History - -} - - -declare module "history/lib/createHashHistory" { - - export default function createHashHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History - -} - - -declare module "history/lib/createMemoryHistory" { - - export default function createMemoryHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History - -} - - -declare module "history/lib/createLocation" { - - export default function createLocation(path?: HistoryModule.Path, state?: HistoryModule.LocationState, action?: HistoryModule.Action, key?: HistoryModule.LocationKey): HistoryModule.Location - -} - - -declare module "history/lib/useBasename" { - - export default function useBasename(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory - -} - - -declare module "history/lib/useBeforeUnload" { - - export default function useBeforeUnload(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory - -} - - -declare module "history/lib/useQueries" { - - export default function useQueries(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory - -} - - -declare module "history/lib/actions" { - - export const PUSH: string - - export const REPLACE: string - - export const POP: string - - export default { - PUSH, - REPLACE, - POP - } - -} - -declare module "history/lib/DOMUtils" { - export function addEventListener(node: EventTarget, event: string, listener: EventListenerOrEventListenerObject): void; - export function removeEventListener(node: EventTarget, event: string, listener: EventListenerOrEventListenerObject): void; - export function getHashPath(): string; - export function replaceHashPath(path: string): void; - export function getWindowPath(): string; - export function go(n: number): void; - export function getUserConfirmation(message: string, callback: (result: boolean) => void): void; - export function supportsHistory(): boolean; - export function supportsGoWithoutReloadUsingHash(): boolean; -} - - -declare module "history" { - - export { default as createHistory } from "history/lib/createBrowserHistory" - - export { default as createHashHistory } from "history/lib/createHashHistory" - - export { default as createMemoryHistory } from "history/lib/createMemoryHistory" - - export { default as createLocation } from "history/lib/createLocation" - - export { default as useBasename } from "history/lib/useBasename" - - export { default as useBeforeUnload } from "history/lib/useBeforeUnload" - - export { default as useQueries } from "history/lib/useQueries" - - import * as Actions from "history/lib/actions" - - export { Actions } - -} diff --git a/templates/KnockoutSpa/typings/requirejs/require.d.ts b/templates/KnockoutSpa/typings/requirejs/require.d.ts deleted file mode 100644 index e9cdb3e8..00000000 --- a/templates/KnockoutSpa/typings/requirejs/require.d.ts +++ /dev/null @@ -1,397 +0,0 @@ -// Type definitions for RequireJS 2.1.20 -// Project: http://requirejs.org/ -// Definitions by: Josh Baldwin -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/* -require-2.1.8.d.ts may be freely distributed under the MIT license. - -Copyright (c) 2013 Josh Baldwin https://github.com/jbaldwin/require.d.ts - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. -*/ - -declare module 'module' { - var mod: { - config: () => any; - id: string; - uri: string; - } - export = mod; -} - -interface RequireError extends Error { - - /** - * The error ID that maps to an ID on a web page. - **/ - requireType: string; - - /** - * Required modules. - **/ - requireModules: string[]; - - /** - * The original error, if there is one (might be null). - **/ - originalError: Error; -} - -interface RequireShim { - - /** - * List of dependencies. - **/ - deps?: string[]; - - /** - * Name the module will be exported as. - **/ - exports?: string; - - /** - * Initialize function with all dependcies passed in, - * if the function returns a value then that value is used - * as the module export value instead of the object - * found via the 'exports' string. - * @param dependencies - * @return - **/ - init?: (...dependencies: any[]) => any; -} - -interface RequireConfig { - - // The root path to use for all module lookups. - baseUrl?: string; - - // Path mappings for module names not found directly under - // baseUrl. - paths?: { [key: string]: any; }; - - - // Dictionary of Shim's. - // does not cover case of key->string[] - shim?: { [key: string]: RequireShim; }; - - /** - * For the given module prefix, instead of loading the - * module with the given ID, substitude a different - * module ID. - * - * @example - * requirejs.config({ - * map: { - * 'some/newmodule': { - * 'foo': 'foo1.2' - * }, - * 'some/oldmodule': { - * 'foo': 'foo1.0' - * } - * } - * }); - **/ - map?: { - [id: string]: { - [id: string]: string; - }; - }; - - /** - * Allows pointing multiple module IDs to a module ID that contains a bundle of modules. - * - * @example - * requirejs.config({ - * bundles: { - * 'primary': ['main', 'util', 'text', 'text!template.html'], - * 'secondary': ['text!secondary.html'] - * } - * }); - **/ - bundles?: { [key: string]: string[]; }; - - /** - * AMD configurations, use module.config() to access in - * define() functions - **/ - config?: { [id: string]: {}; }; - - /** - * Configures loading modules from CommonJS packages. - **/ - packages?: {}; - - /** - * The number of seconds to wait before giving up on loading - * a script. The default is 7 seconds. - **/ - waitSeconds?: number; - - /** - * A name to give to a loading context. This allows require.js - * to load multiple versions of modules in a page, as long as - * each top-level require call specifies a unique context string. - **/ - context?: string; - - /** - * An array of dependencies to load. - **/ - deps?: string[]; - - /** - * A function to pass to require that should be require after - * deps have been loaded. - * @param modules - **/ - callback?: (...modules: any[]) => void; - - /** - * If set to true, an error will be thrown if a script loads - * that does not call define() or have shim exports string - * value that can be checked. - **/ - enforceDefine?: boolean; - - /** - * If set to true, document.createElementNS() will be used - * to create script elements. - **/ - xhtml?: boolean; - - /** - * Extra query string arguments appended to URLs that RequireJS - * uses to fetch resources. Most useful to cache bust when - * the browser or server is not configured correctly. - * - * @example - * urlArgs: "bust= + (new Date()).getTime() - **/ - urlArgs?: string; - - /** - * Specify the value for the type="" attribute used for script - * tags inserted into the document by RequireJS. Default is - * "text/javascript". To use Firefox's JavasScript 1.8 - * features, use "text/javascript;version=1.8". - **/ - scriptType?: string; - - /** - * If set to true, skips the data-main attribute scanning done - * to start module loading. Useful if RequireJS is embedded in - * a utility library that may interact with other RequireJS - * library on the page, and the embedded version should not do - * data-main loading. - **/ - skipDataMain?: boolean; - - /** - * Allow extending requirejs to support Subresource Integrity - * (SRI). - **/ - onNodeCreated?: (node: HTMLScriptElement, config: RequireConfig, moduleName: string, url: string) => void; -} - -// todo: not sure what to do with this guy -interface RequireModule { - - /** - * - **/ - config(): {}; - -} - -/** -* -**/ -interface RequireMap { - - /** - * - **/ - prefix: string; - - /** - * - **/ - name: string; - - /** - * - **/ - parentMap: RequireMap; - - /** - * - **/ - url: string; - - /** - * - **/ - originalName: string; - - /** - * - **/ - fullName: string; -} - -interface Require { - - /** - * Configure require.js - **/ - config(config: RequireConfig): Require; - - /** - * CommonJS require call - * @param module Module to load - * @return The loaded module - */ - (module: string): any; - - /** - * Start the main app logic. - * Callback is optional. - * Can alternatively use deps and callback. - * @param modules Required modules to load. - **/ - (modules: string[]): void; - - /** - * @see Require() - * @param ready Called when required modules are ready. - **/ - (modules: string[], ready: Function): void; - - /** - * @see http://requirejs.org/docs/api.html#errbacks - * @param ready Called when required modules are ready. - **/ - (modules: string[], ready: Function, errback: Function): void; - - /** - * Generate URLs from require module - * @param module Module to URL - * @return URL string - **/ - toUrl(module: string): string; - - /** - * Returns true if the module has already been loaded and defined. - * @param module Module to check - **/ - defined(module: string): boolean; - - /** - * Returns true if the module has already been requested or is in the process of loading and should be available at some point. - * @param module Module to check - **/ - specified(module: string): boolean; - - /** - * On Error override - * @param err - **/ - onError(err: RequireError, errback?: (err: RequireError) => void): void; - - /** - * Undefine a module - * @param module Module to undefine. - **/ - undef(module: string): void; - - /** - * Semi-private function, overload in special instance of undef() - **/ - onResourceLoad(context: Object, map: RequireMap, depArray: RequireMap[]): void; -} - -interface RequireDefine { - - /** - * Define Simple Name/Value Pairs - * @param config Dictionary of Named/Value pairs for the config. - **/ - (config: { [key: string]: any; }): void; - - /** - * Define function. - * @param func: The function module. - **/ - (func: () => any): void; - - /** - * Define function with dependencies. - * @param deps List of dependencies module IDs. - * @param ready Callback function when the dependencies are loaded. - * callback param deps module dependencies - * callback return module definition - **/ - (deps: string[], ready: Function): void; - - /** - * Define module with simplified CommonJS wrapper. - * @param ready - * callback require requirejs instance - * callback exports exports object - * callback module module - * callback return module definition - **/ - (ready: (require: Require, exports: { [key: string]: any; }, module: RequireModule) => any): void; - - /** - * Define a module with a name and dependencies. - * @param name The name of the module. - * @param deps List of dependencies module IDs. - * @param ready Callback function when the dependencies are loaded. - * callback deps module dependencies - * callback return module definition - **/ - (name: string, deps: string[], ready: Function): void; - - /** - * Define a module with a name. - * @param name The name of the module. - * @param ready Callback function when the dependencies are loaded. - * callback return module definition - **/ - (name: string, ready: Function): void; - - /** - * Used to allow a clear indicator that a global define function (as needed for script src browser loading) conforms - * to the AMD API, any global define function SHOULD have a property called "amd" whose value is an object. - * This helps avoid conflict with any other existing JavaScript code that could have defined a define() function - * that does not conform to the AMD API. - * define.amd.jQuery is specific to jQuery and indicates that the loader is able to account for multiple version - * of jQuery being loaded simultaneously. - */ - amd: Object; -} - -// Ambient declarations for 'require' and 'define' -declare var requirejs: Require; -declare var require: Require; -declare var define: RequireDefine; diff --git a/templates/KnockoutSpa/typings/tsd.d.ts b/templates/KnockoutSpa/typings/tsd.d.ts deleted file mode 100644 index c0e628b1..00000000 --- a/templates/KnockoutSpa/typings/tsd.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// -/// -/// -/// -/// -/// -/// -/// diff --git a/templates/KnockoutSpa/typings/whatwg-fetch/whatwg-fetch.d.ts b/templates/KnockoutSpa/typings/whatwg-fetch/whatwg-fetch.d.ts deleted file mode 100644 index 64dd9048..00000000 --- a/templates/KnockoutSpa/typings/whatwg-fetch/whatwg-fetch.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -// Type definitions for fetch API -// Project: https://github.com/github/fetch -// Definitions by: Ryan Graham -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare class Request extends Body { - constructor(input: string|Request, init?:RequestInit); - method: string; - url: string; - headers: Headers; - context: string|RequestContext; - referrer: string; - mode: string|RequestMode; - credentials: string|RequestCredentials; - cache: string|RequestCache; -} - -interface RequestInit { - method?: string; - headers?: HeaderInit|{ [index: string]: string }; - body?: BodyInit; - mode?: string|RequestMode; - credentials?: string|RequestCredentials; - cache?: string|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; - json(): Promise; - text(): Promise; -} -declare class Response extends Body { - constructor(body?: BodyInit, init?: ResponseInit); - error(): Response; - redirect(url: string, status: number): Response; - type: string|ResponseType; - url: string; - status: number; - ok: boolean; - statusText: string; - headers: Headers; - clone(): Response; -} - -declare enum ResponseType { "basic", "cors", "default", "error", "opaque" } - -interface 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|Request, init?: RequestInit): Promise; -} - -declare var fetch: typeof window.fetch; diff --git a/templates/KnockoutSpa/web.config b/templates/KnockoutSpa/web.config deleted file mode 100644 index a8d66727..00000000 --- a/templates/KnockoutSpa/web.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/templates/KnockoutSpa/webpack.config.dev.js b/templates/KnockoutSpa/webpack.config.dev.js deleted file mode 100644 index fd41ce68..00000000 --- a/templates/KnockoutSpa/webpack.config.dev.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - devtool: 'inline-source-map', - module: { - loaders: [ - { test: /\.css/, loader: 'style!css' } - ] - } -}; diff --git a/templates/KnockoutSpa/webpack.config.js b/templates/KnockoutSpa/webpack.config.js deleted file mode 100644 index 5f8d2909..00000000 --- a/templates/KnockoutSpa/webpack.config.js +++ /dev/null @@ -1,32 +0,0 @@ -var path = require('path'); -var webpack = require('webpack'); -var merge = require('extendify')({ isDeep: true, arrays: 'concat' }); -var devConfig = require('./webpack.config.dev'); -var prodConfig = require('./webpack.config.prod'); -var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; - -module.exports = merge({ - resolve: { - extensions: [ '', '.js', '.ts' ] - }, - module: { - loaders: [ - { test: /\.ts(x?)$/, include: /ClientApp/, loader: 'ts-loader' }, - { test: /\.html$/, loader: 'raw-loader' } - ] - }, - entry: { - main: ['./ClientApp/boot.ts'], - }, - output: { - path: path.join(__dirname, 'wwwroot', 'dist'), - filename: '[name].js', - publicPath: '/dist/' - }, - plugins: [ - new webpack.DllReferencePlugin({ - context: __dirname, - manifest: require('./wwwroot/dist/vendor-manifest.json') - }) - ] -}, isDevelopment ? devConfig : prodConfig); diff --git a/templates/KnockoutSpa/webpack.config.prod.js b/templates/KnockoutSpa/webpack.config.prod.js deleted file mode 100644 index 068da382..00000000 --- a/templates/KnockoutSpa/webpack.config.prod.js +++ /dev/null @@ -1,16 +0,0 @@ -var webpack = require('webpack'); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); -var extractCSS = new ExtractTextPlugin('site.css'); - -module.exports = { - module: { - loaders: [ - { test: /\.css/, loader: extractCSS.extract(['css']) }, - ] - }, - plugins: [ - extractCSS, - new webpack.optimize.OccurenceOrderPlugin(), - new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }) - ] -}; diff --git a/templates/KnockoutSpa/webpack.config.vendor.js b/templates/KnockoutSpa/webpack.config.vendor.js deleted file mode 100644 index 36375795..00000000 --- a/templates/KnockoutSpa/webpack.config.vendor.js +++ /dev/null @@ -1,36 +0,0 @@ -var path = require('path'); -var webpack = require('webpack'); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); -var extractCSS = new ExtractTextPlugin('vendor.css'); -var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; - -module.exports = { - resolve: { - extensions: [ '', '.js' ] - }, - module: { - loaders: [ - { test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }, - { test: /\.css/, loader: extractCSS.extract(['css']) } - ] - }, - entry: { - vendor: ['bootstrap', 'bootstrap/dist/css/bootstrap.css', 'knockout', 'crossroads', 'history', 'style-loader', 'jquery'], - }, - output: { - path: path.join(__dirname, 'wwwroot', 'dist'), - filename: '[name].js', - library: '[name]_[hash]', - }, - plugins: [ - extractCSS, - new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable) - new webpack.optimize.OccurenceOrderPlugin(), - new webpack.DllPlugin({ - path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'), - name: '[name]_[hash]' - }) - ].concat(isDevelopment ? [] : [ - new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }) - ]) -}; diff --git a/templates/KnockoutSpa/wwwroot/favicon.ico b/templates/KnockoutSpa/wwwroot/favicon.ico deleted file mode 100755 index a3a79998..00000000 Binary files a/templates/KnockoutSpa/wwwroot/favicon.ico and /dev/null differ diff --git a/templates/KnockoutSpa/wwwroot/web.config b/templates/KnockoutSpa/wwwroot/web.config deleted file mode 100644 index e70a7778..00000000 --- a/templates/KnockoutSpa/wwwroot/web.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/templates/ReactReduxSpa/.babelrc b/templates/ReactReduxSpa/.babelrc deleted file mode 100644 index 86c445f5..00000000 --- a/templates/ReactReduxSpa/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["es2015", "react"] -} diff --git a/templates/ReactReduxSpa/ClientApp/boot-client.tsx b/templates/ReactReduxSpa/ClientApp/boot-client.tsx deleted file mode 100644 index 4dc12af3..00000000 --- a/templates/ReactReduxSpa/ClientApp/boot-client.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import './css/site.css'; -import 'bootstrap'; -import * as React from 'react'; -import * as ReactDOM from 'react-dom'; -import { browserHistory, Router } from 'react-router'; -import { Provider } from 'react-redux'; -import { syncHistoryWithStore } from 'react-router-redux'; -import routes from './routes'; -import configureStore from './configureStore'; -import { ApplicationState } from './store'; - -// Get the application-wide store instance, prepopulating with state from the server where available. -const initialState = (window as any).initialReduxState as ApplicationState; -const store = configureStore(initialState); -const history = syncHistoryWithStore(browserHistory, store); - -// This code starts up the React app when it runs in a browser. It sets up the routing configuration -// and injects the app into a DOM element. -ReactDOM.render( - - - , - document.getElementById('react-app') -); diff --git a/templates/ReactReduxSpa/ClientApp/boot-server.tsx b/templates/ReactReduxSpa/ClientApp/boot-server.tsx deleted file mode 100644 index fa3289ea..00000000 --- a/templates/ReactReduxSpa/ClientApp/boot-server.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import * as React from 'react'; -import { Provider } from 'react-redux'; -import { renderToString } from 'react-dom/server'; -import { match, RouterContext } from 'react-router'; -import createMemoryHistory from 'history/lib/createMemoryHistory'; -import routes from './routes'; -import configureStore from './configureStore'; - -export default function (params: any): Promise<{ html: string }> { - return new Promise<{ html: string, globals: { [key: string]: any } }>((resolve, reject) => { - // Match the incoming request against the list of client-side routes - match({ routes, location: params.location }, (error, redirectLocation, renderProps: any) => { - if (error) { - throw error; - } - - // If it didn't match any route, renderProps will be undefined - if (!renderProps) { - throw new Error(`The location '${ params.url }' doesn't match any route configured in react-router.`); - } - - // Build an instance of the application - const store = configureStore(); - const app = ( - - - - ); - - // Perform an initial render that will cause any async tasks (e.g., data access) to begin - renderToString(app); - - // Once the tasks are done, we can perform the final render - // We also send the redux store state, so the client can continue execution where the server left off - params.domainTasks.then(() => { - resolve({ - html: renderToString(app), - globals: { initialReduxState: store.getState() } - }); - }, reject); // Also propagate any errors back into the host application - }); - }); -} diff --git a/templates/ReactReduxSpa/ClientApp/components/Counter.tsx b/templates/ReactReduxSpa/ClientApp/components/Counter.tsx deleted file mode 100644 index 6b8f05cb..00000000 --- a/templates/ReactReduxSpa/ClientApp/components/Counter.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import * as React from 'react'; -import { Link } from 'react-router'; -import { provide } from 'redux-typed'; -import { ApplicationState } from '../store'; -import * as CounterStore from '../store/Counter'; - -class Counter extends React.Component { - public render() { - return
    -

    Counter

    - -

    This is a simple example of a React component.

    - -

    Current count: { this.props.count }

    - - -
    ; - } -} - -// Build the CounterProps type, which allows the component to be strongly typed -const provider = provide( - (state: ApplicationState) => state.counter, // Select which part of global state maps to this component - CounterStore.actionCreators // Select which action creators should be exposed to this component -); -type CounterProps = typeof provider.allProps; -export default provider.connect(Counter); diff --git a/templates/ReactReduxSpa/ClientApp/components/FetchData.tsx b/templates/ReactReduxSpa/ClientApp/components/FetchData.tsx deleted file mode 100644 index d204029a..00000000 --- a/templates/ReactReduxSpa/ClientApp/components/FetchData.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import * as React from 'react'; -import { Link } from 'react-router'; -import { provide } from 'redux-typed'; -import { ApplicationState } from '../store'; -import * as WeatherForecastsState from '../store/WeatherForecasts'; - -interface RouteParams { - startDateIndex: string; -} - -class FetchData extends React.Component { - componentWillMount() { - // This method runs when the component is first added to the page - let startDateIndex = parseInt(this.props.params.startDateIndex) || 0; - this.props.requestWeatherForecasts(startDateIndex); - } - - componentWillReceiveProps(nextProps: WeatherForecastProps) { - // This method runs when incoming props (e.g., route params) change - let startDateIndex = parseInt(nextProps.params.startDateIndex) || 0; - this.props.requestWeatherForecasts(startDateIndex); - } - - public render() { - return
    -

    Weather forecast

    -

    This component demonstrates fetching data from the server and working with URL parameters.

    - { this.renderForecastsTable() } - { this.renderPagination() } -
    ; - } - - private renderForecastsTable() { - return - - - - - - - - - - {this.props.forecasts.map(forecast => - - - - - - - )} - -
    DateTemp. (C)Temp. (F)Summary
    { forecast.dateFormatted }{ forecast.temperatureC }{ forecast.temperatureF }{ forecast.summary }
    ; - } - - private renderPagination() { - let prevStartDateIndex = this.props.startDateIndex - 5; - let nextStartDateIndex = this.props.startDateIndex + 5; - - return

    - Previous - Next - { this.props.isLoading ? Loading... : [] } -

    ; - } -} - -// Build the WeatherForecastProps type, which allows the component to be strongly typed -const provider = provide( - (state: ApplicationState) => state.weatherForecasts, // Select which part of global state maps to this component - WeatherForecastsState.actionCreators // Select which action creators should be exposed to this component -).withExternalProps<{ params: RouteParams }>(); // Also include a 'params' property on WeatherForecastProps -type WeatherForecastProps = typeof provider.allProps; -export default provider.connect(FetchData); diff --git a/templates/ReactReduxSpa/ClientApp/components/Home.tsx b/templates/ReactReduxSpa/ClientApp/components/Home.tsx deleted file mode 100644 index 50995624..00000000 --- a/templates/ReactReduxSpa/ClientApp/components/Home.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import * as React from 'react'; - -export default class Home extends React.Component { - public render() { - return
    -

    Hello, world!

    -

    Welcome to your new single-page application, built with:

    - -

    To help you get started, we've also set up:

    -
      -
    • Client-side navigation. For example, click Counter then Back to return here.
    • -
    • Webpack dev middleware. In development mode, there's no need to run the webpack build tool. Your client-side resources are dynamically built on demand. Updates are available as soon as you modify any file.
    • -
    • Hot module replacement. In development mode, you don't even need to reload the page after making most changes. Within seconds of saving changes to files, rebuilt React components will be injected directly into your running application, preserving its live state.
    • -
    • Efficient production builds. In production mode, development-time features are disabled, and the webpack build tool produces minified static CSS and JavaScript files.
    • -
    • Server-side prerendering. To optimize startup time, your React application is first rendered on the server. The initial HTML and state is then transferred to the browser, where client-side code picks up where the server left off.
    • -
    -
    ; - } -} diff --git a/templates/ReactReduxSpa/ClientApp/components/Layout.tsx b/templates/ReactReduxSpa/ClientApp/components/Layout.tsx deleted file mode 100644 index b9f877bd..00000000 --- a/templates/ReactReduxSpa/ClientApp/components/Layout.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from 'react'; -import { NavMenu } from './NavMenu'; - -export interface LayoutProps { - body: React.ReactElement; -} - -export class Layout extends React.Component { - public render() { - return
    -
    -
    - -
    -
    - { this.props.body } -
    -
    -
    ; - } -} diff --git a/templates/ReactReduxSpa/ClientApp/components/NavMenu.tsx b/templates/ReactReduxSpa/ClientApp/components/NavMenu.tsx deleted file mode 100644 index e3158f61..00000000 --- a/templates/ReactReduxSpa/ClientApp/components/NavMenu.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import * as React from 'react'; -import { Link } from 'react-router'; - -export class NavMenu extends React.Component { - public render() { - return
    -
    -
    - - WebApplicationBasic -
    -
    -
    -
      -
    • - - Home - -
    • -
    • - - Counter - -
    • -
    • - - Fetch data - -
    • -
    -
    -
    -
    ; - } -} diff --git a/templates/ReactReduxSpa/ClientApp/configureStore.ts b/templates/ReactReduxSpa/ClientApp/configureStore.ts deleted file mode 100644 index 3ce14319..00000000 --- a/templates/ReactReduxSpa/ClientApp/configureStore.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { createStore, applyMiddleware, compose, combineReducers } from 'redux'; -import * as thunkModule from 'redux-thunk'; -import { routerReducer } from 'react-router-redux'; -import * as Store from './store'; -import { typedToPlain } from 'redux-typed'; - -export default function configureStore(initialState?: Store.ApplicationState) { - // Build middleware. These are functions that can process the actions before they reach the store. - const thunk = (thunkModule as any).default; // Workaround for TypeScript not importing thunk module as expected - const windowIfDefined = typeof window === 'undefined' ? null : window as any; - const devToolsExtension = windowIfDefined && windowIfDefined.devToolsExtension; // If devTools is installed, connect to it - const createStoreWithMiddleware = compose( - applyMiddleware(thunk, typedToPlain), - devToolsExtension ? devToolsExtension() : f => f - )(createStore); - - // Combine all reducers and instantiate the app-wide store instance - const allReducers = buildRootReducer(Store.reducers); - const store = createStoreWithMiddleware(allReducers, initialState) as Redux.Store; - - // Enable Webpack hot module replacement for reducers - if (module.hot) { - module.hot.accept('./store', () => { - const nextRootReducer = require('./store'); - store.replaceReducer(buildRootReducer(nextRootReducer.reducers)); - }); - } - - return store; -} - -function buildRootReducer(allReducers) { - return combineReducers(Object.assign({}, allReducers, { routing: routerReducer })) as Redux.Reducer; -} diff --git a/templates/ReactReduxSpa/ClientApp/css/site.css b/templates/ReactReduxSpa/ClientApp/css/site.css deleted file mode 100755 index 3058af68..00000000 --- a/templates/ReactReduxSpa/ClientApp/css/site.css +++ /dev/null @@ -1,66 +0,0 @@ -.main-nav li .glyphicon { - margin-right: 10px; -} - -/* Highlighting rules for nav menu items */ -.main-nav li a.active, -.main-nav li a.active:hover, -.main-nav li a.active:focus { - background-color: #4189C7; - color: white; -} - -/* Keep the nav menu independent of scrolling and on top of other items */ -.main-nav { - position: fixed; - top: 0; - left: 0; - right: 0; - z-index: 1; -} - -@media (max-width: 767px) { - /* On small screens, the nav menu spans the full width of the screen. Leave a space for it. */ - body { - padding-top: 50px; - } -} - -@media (min-width: 768px) { - /* On small screens, convert the nav menu to a vertical sidebar */ - .main-nav { - height: 100%; - width: calc(25% - 20px); - } - .main-nav .navbar { - border-radius: 0px; - border-width: 0px; - height: 100%; - } - .main-nav .navbar-header { - float: none; - } - .main-nav .navbar-collapse { - border-top: 1px solid #444; - padding: 0px; - } - .main-nav .navbar ul { - float: none; - } - .main-nav .navbar li { - float: none; - font-size: 15px; - margin: 6px; - } - .main-nav .navbar li a { - padding: 10px 16px; - border-radius: 4px; - } - .main-nav .navbar a { - /* If a menu item's text is too long, truncate it */ - width: 100%; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } -} diff --git a/templates/ReactReduxSpa/ClientApp/routes.tsx b/templates/ReactReduxSpa/ClientApp/routes.tsx deleted file mode 100644 index da2f915a..00000000 --- a/templates/ReactReduxSpa/ClientApp/routes.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import * as React from 'react'; -import { Router, Route, HistoryBase } from 'react-router'; -import { Layout } from './components/Layout'; -import Home from './components/Home'; -import FetchData from './components/FetchData'; -import Counter from './components/Counter'; - -export default - - - - { /* Optional route segment that does not affect NavMenu highlighting */ } - -; diff --git a/templates/ReactReduxSpa/ClientApp/store/Counter.ts b/templates/ReactReduxSpa/ClientApp/store/Counter.ts deleted file mode 100644 index cf852abe..00000000 --- a/templates/ReactReduxSpa/ClientApp/store/Counter.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { typeName, isActionType, Action, Reducer } from 'redux-typed'; -import { ActionCreator } from './'; - -// ----------------- -// STATE - This defines the type of data maintained in the Redux store. - -export interface CounterState { - count: number; -} - -// ----------------- -// ACTIONS - These are serializable (hence replayable) descriptions of state transitions. -// They do not themselves have any side-effects; they just describe something that is going to happen. -// Use @typeName and isActionType for type detection that works even after serialization/deserialization. - -@typeName("INCREMENT_COUNT") -class IncrementCount extends Action { -} - -// ---------------- -// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition. -// They don't directly mutate state, but they can have external side-effects (such as loading data). - -export const actionCreators = { - increment: (): ActionCreator => (dispatch, getState) => { - dispatch(new IncrementCount()); - } -}; - -// ---------------- -// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state. -export const reducer: Reducer = (state, action) => { - if (isActionType(action, IncrementCount)) { - return { count: state.count + 1 }; - } - - // For unrecognized actions (or in cases where actions have no effect), must return the existing state - // (or default initial state if none was supplied) - return state || { count: 0 }; -}; diff --git a/templates/ReactReduxSpa/ClientApp/store/WeatherForecasts.ts b/templates/ReactReduxSpa/ClientApp/store/WeatherForecasts.ts deleted file mode 100644 index 3101a7dd..00000000 --- a/templates/ReactReduxSpa/ClientApp/store/WeatherForecasts.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { fetch, addTask } from 'domain-task'; -import { typeName, isActionType, Action, Reducer } from 'redux-typed'; -import { ActionCreator } from './'; - -// ----------------- -// STATE - This defines the type of data maintained in the Redux store. - -export interface WeatherForecastsState { - isLoading: boolean; - startDateIndex: number; - forecasts: WeatherForecast[]; -} - -export interface WeatherForecast { - dateFormatted: string; - temperatureC: number; - temperatureF: number; - summary: string; -} - -// ----------------- -// ACTIONS - These are serializable (hence replayable) descriptions of state transitions. -// They do not themselves have any side-effects; they just describe something that is going to happen. -// Use @typeName and isActionType for type detection that works even after serialization/deserialization. - -@typeName("REQUEST_WEATHER_FORECASTS") -class RequestWeatherForecasts extends Action { - constructor(public startDateIndex: number) { - super(); - } -} - -@typeName("RECEIVE_WEATHER_FORECASTS") -class ReceiveWeatherForecasts extends Action { - constructor(public startDateIndex: number, public forecasts: WeatherForecast[]) { - super(); - } -} - -// ---------------- -// ACTION CREATORS - These are functions exposed to UI components that will trigger a state transition. -// They don't directly mutate state, but they can have external side-effects (such as loading data). - -export const actionCreators = { - requestWeatherForecasts: (startDateIndex: number): ActionCreator => (dispatch, getState) => { - // Only load data if it's something we don't already have (and are not already loading) - if (startDateIndex !== getState().weatherForecasts.startDateIndex) { - let fetchTask = fetch(`/api/SampleData/WeatherForecasts?startDateIndex=${ startDateIndex }`) - .then(response => response.json()) - .then((data: WeatherForecast[]) => { - dispatch(new ReceiveWeatherForecasts(startDateIndex, data)); - }); - - addTask(fetchTask); // Ensure server-side prerendering waits for this to complete - dispatch(new RequestWeatherForecasts(startDateIndex)); - } - } -}; - -// ---------------- -// REDUCER - For a given state and action, returns the new state. To support time travel, this must not mutate the old state. -const unloadedState: WeatherForecastsState = { startDateIndex: null, forecasts: [], isLoading: false }; -export const reducer: Reducer = (state, action) => { - if (isActionType(action, RequestWeatherForecasts)) { - return { startDateIndex: action.startDateIndex, isLoading: true, forecasts: state.forecasts }; - } else if (isActionType(action, ReceiveWeatherForecasts)) { - // Only accept the incoming data if it matches the most recent request. This ensures we correctly - // handle out-of-order responses. - if (action.startDateIndex === state.startDateIndex) { - return { startDateIndex: action.startDateIndex, forecasts: action.forecasts, isLoading: false }; - } - } - - // For unrecognized actions (or in cases where actions have no effect), must return the existing state - // (or default initial state if none was supplied) - return state || unloadedState; -}; diff --git a/templates/ReactReduxSpa/ClientApp/store/index.ts b/templates/ReactReduxSpa/ClientApp/store/index.ts deleted file mode 100644 index 1f4798b4..00000000 --- a/templates/ReactReduxSpa/ClientApp/store/index.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { ActionCreatorGeneric } from 'redux-typed'; -import * as WeatherForecasts from './WeatherForecasts'; -import * as Counter from './Counter'; - -// The top-level state object -export interface ApplicationState { - counter: Counter.CounterState, - weatherForecasts: WeatherForecasts.WeatherForecastsState -} - -// Whenever an action is dispatched, Redux will update each top-level application state property using -// the reducer with the matching name. It's important that the names match exactly, and that the reducer -// acts on the corresponding ApplicationState property type. -export const reducers = { - counter: Counter.reducer, - weatherForecasts: WeatherForecasts.reducer -}; - -// This type can be used as a hint on action creators so that its 'dispatch' and 'getState' params are -// correctly typed to match your store. -export type ActionCreator = ActionCreatorGeneric; diff --git a/templates/ReactReduxSpa/Controllers/HomeController.cs b/templates/ReactReduxSpa/Controllers/HomeController.cs deleted file mode 100755 index 9d75da88..00000000 --- a/templates/ReactReduxSpa/Controllers/HomeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace WebApplicationBasic.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - - public IActionResult Error() - { - return View(); - } - } -} diff --git a/templates/ReactReduxSpa/Controllers/SampleDataController.cs b/templates/ReactReduxSpa/Controllers/SampleDataController.cs deleted file mode 100644 index 9f240570..00000000 --- a/templates/ReactReduxSpa/Controllers/SampleDataController.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace WebApplicationBasic.Controllers -{ - [Route("api/[controller]")] - public class SampleDataController : Controller - { - private static string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - [HttpGet("[action]")] - public IEnumerable WeatherForecasts(int startDateIndex) - { - var rng = new Random(); - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - DateFormatted = DateTime.Now.AddDays(index + startDateIndex).ToString("d"), - TemperatureC = rng.Next(-20, 55), - Summary = Summaries[rng.Next(Summaries.Length)] - }); - } - - public class WeatherForecast - { - public string DateFormatted { get; set; } - public int TemperatureC { get; set; } - public string Summary { get; set; } - - public int TemperatureF - { - get - { - return 32 + (int)(this.TemperatureC / 0.5556); - } - } - } - } -} diff --git a/templates/ReactReduxSpa/Dockerfile b/templates/ReactReduxSpa/Dockerfile deleted file mode 100644 index 63d7c456..00000000 --- a/templates/ReactReduxSpa/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM microsoft/aspnet:1.0.0-rc1-update1 - -RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list -RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/* - -COPY . /app -WORKDIR /app -RUN ["dnu", "restore"] - -EXPOSE 5000/tcp -ENTRYPOINT ["dnx", "-p", "project.json", "web"] diff --git a/templates/ReactReduxSpa/README.md b/templates/ReactReduxSpa/README.md deleted file mode 100644 index 4e494c9a..00000000 --- a/templates/ReactReduxSpa/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Welcome to ASP.NET 5 - -We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. - -You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) - -## This application consists of: - -* Sample pages using ASP.NET MVC 6 -* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side libraries -* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) - -## How to - -* [Add a Controller and View](http://go.microsoft.com/fwlink/?LinkID=398600) -* [Add an appsetting in config and access it in app.](http://go.microsoft.com/fwlink/?LinkID=699562) -* [Manage User Secrets using Secret Manager.](http://go.microsoft.com/fwlink/?LinkId=699315) -* [Use logging to log a message.](http://go.microsoft.com/fwlink/?LinkId=699316) -* [Add packages using NuGet.](http://go.microsoft.com/fwlink/?LinkId=699317) -* [Add client packages using Bower.](http://go.microsoft.com/fwlink/?LinkId=699318) -* [Target development, staging or production environment.](http://go.microsoft.com/fwlink/?LinkId=699319) - -## Overview - -* [Conceptual overview of what is ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518008) -* [Fundamentals of ASP.NET 5 such as Startup and middleware.](http://go.microsoft.com/fwlink/?LinkId=699320) -* [Working with Data](http://go.microsoft.com/fwlink/?LinkId=398602) -* [Security](http://go.microsoft.com/fwlink/?LinkId=398603) -* [Client side development](http://go.microsoft.com/fwlink/?LinkID=699321) -* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=699322) -* [Read more on the documentation site](http://go.microsoft.com/fwlink/?LinkID=699323) - -## Run & Deploy - -* [Run your app](http://go.microsoft.com/fwlink/?LinkID=517851) -* [Run your app on .NET Core](http://go.microsoft.com/fwlink/?LinkID=517852) -* [Run commands in your project.json](http://go.microsoft.com/fwlink/?LinkID=517853) -* [Publish to Microsoft Azure Web Apps](http://go.microsoft.com/fwlink/?LinkID=398609) - -We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/templates/ReactReduxSpa/ReactReduxSpa.xproj b/templates/ReactReduxSpa/ReactReduxSpa.xproj deleted file mode 100644 index 0996bb60..00000000 --- a/templates/ReactReduxSpa/ReactReduxSpa.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - true - - - - dbfc6db0-a6d1-4694-a108-1c604b988da3 - ReactReduxSpa - ..\..\..\JavaScriptServices.sln\artifacts\obj\$(MSBuildProjectName) - .\bin\ - - - 2.0 - 2018 - - - \ No newline at end of file diff --git a/templates/ReactReduxSpa/Startup.cs b/templates/ReactReduxSpa/Startup.cs deleted file mode 100755 index 6f4babb1..00000000 --- a/templates/ReactReduxSpa/Startup.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.SpaServices.Webpack; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Newtonsoft.Json.Serialization; - -namespace WebApplicationBasic -{ - public class Startup - { - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc().AddJsonOptions(options => - { - options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); - }); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHostingEnvironment env) - { - app.UseDeveloperExceptionPage(); - - if (env.IsDevelopment()) { - app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { - HotModuleReplacement = true, - ReactHotModuleReplacement = true - }); - } - - app.UseStaticFiles(); - loggerFactory.AddConsole(); - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - - routes.MapSpaFallbackRoute( - name: "spa-fallback", - defaults: new { controller = "Home", action = "Index" }); - }); - } - - public static void Main(string[] args) - { - var host = new WebHostBuilder() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseKestrel() - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/templates/ReactReduxSpa/Views/Home/Index.cshtml b/templates/ReactReduxSpa/Views/Home/Index.cshtml deleted file mode 100644 index 752d8d9c..00000000 --- a/templates/ReactReduxSpa/Views/Home/Index.cshtml +++ /dev/null @@ -1,10 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - -
    Loading...
    - -@section scripts { - -} diff --git a/templates/ReactReduxSpa/Views/Shared/Error.cshtml b/templates/ReactReduxSpa/Views/Shared/Error.cshtml deleted file mode 100755 index 473b35d6..00000000 --- a/templates/ReactReduxSpa/Views/Shared/Error.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ViewData["Title"] = "Error"; -} - -

    Error.

    -

    An error occurred while processing your request.

    diff --git a/templates/ReactReduxSpa/Views/Shared/_Layout.cshtml b/templates/ReactReduxSpa/Views/Shared/_Layout.cshtml deleted file mode 100644 index 67338828..00000000 --- a/templates/ReactReduxSpa/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - @ViewData["Title"] - WebApplicationBasic - - - - - - @RenderBody() - - - @RenderSection("scripts", required: false) - - diff --git a/templates/ReactReduxSpa/Views/_ViewImports.cshtml b/templates/ReactReduxSpa/Views/_ViewImports.cshtml deleted file mode 100755 index e7b4f83f..00000000 --- a/templates/ReactReduxSpa/Views/_ViewImports.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@using WebApplicationBasic -@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" -@addTagHelper "*, Microsoft.AspNetCore.SpaServices" diff --git a/templates/ReactReduxSpa/Views/_ViewStart.cshtml b/templates/ReactReduxSpa/Views/_ViewStart.cshtml deleted file mode 100755 index 820a2f6e..00000000 --- a/templates/ReactReduxSpa/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/templates/ReactReduxSpa/appsettings.json b/templates/ReactReduxSpa/appsettings.json deleted file mode 100755 index e5472e56..00000000 --- a/templates/ReactReduxSpa/appsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Verbose", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/templates/ReactReduxSpa/package.json b/templates/ReactReduxSpa/package.json deleted file mode 100644 index 4070c8af..00000000 --- a/templates/ReactReduxSpa/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "WebApplicationBasic", - "version": "0.0.0", - "devDependencies": { - "aspnet-webpack-react": "^1.0.1", - "babel-loader": "^6.2.3", - "babel-preset-es2015": "^6.5.0", - "babel-preset-react": "^6.5.0", - "bootstrap": "^3.3.6", - "css-loader": "^0.23.1", - "extendify": "^1.0.0", - "extract-text-webpack-plugin": "^1.0.1", - "file-loader": "^0.8.5", - "jquery": "^2.2.1", - "style-loader": "^0.13.0", - "ts-loader": "^0.8.1", - "typescript": "^1.8.2", - "url-loader": "^0.5.7", - "webpack": "^1.12.14", - "webpack-hot-middleware": "^2.10.0" - }, - "dependencies": { - "aspnet-prerendering": "^1.0.2", - "aspnet-webpack": "^1.0.2", - "babel-core": "^6.5.2", - "domain-task": "^2.0.0", - "react": "^15.0.1", - "react-dom": "^15.0.1", - "react-redux": "^4.4.4", - "react-router": "^2.1.1", - "react-router-redux": "^4.0.2", - "redux": "^3.4.0", - "redux-thunk": "^2.0.1", - "redux-typed": "^1.0.0", - "webpack-externals-plugin": "^1.0.0" - } -} diff --git a/templates/ReactReduxSpa/project.json b/templates/ReactReduxSpa/project.json deleted file mode 100755 index f768ecaf..00000000 --- a/templates/ReactReduxSpa/project.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.0", - "type": "platform" - }, - "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", - "Microsoft.AspNetCore.ReactServices": "1.0.0-*", - "Microsoft.AspNetCore.Diagnostics": "1.0.0", - "Microsoft.AspNetCore.Mvc": "1.0.0", - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", - "Microsoft.AspNetCore.StaticFiles": "1.0.0", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Logging": "1.0.0", - "Microsoft.Extensions.Logging.Console": "1.0.0", - "Microsoft.Extensions.Logging.Debug": "1.0.0", - "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { - "version": "1.0.0-preview2-final", - "type": "build" - } - }, - - "tools": { - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.AspNetCore.Server.IISIntegration.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.EntityFrameworkCore.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - }, - "Microsoft.Extensions.SecretManager.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - }, - "Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final" - }, - - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "dotnet5.6", - "dnxcore50", - "portable-net45+win8" - ] - } - }, - - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - - "runtimeOptions": { - "configProperties": { - "System.GC.Server": true - } - }, - - "publishOptions": { - "include": [ - ".babelrc", - "appsettings.json", - "ClientApp", - "node_modules", - "typings", - "Views", - "tsconfig.json", - "tsd.json", - "web.config", - "webpack.*.js", - "wwwroot" - ] - }, - - "scripts": { - "prepublish": [ - "npm install", - "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js", - "node node_modules/webpack/bin/webpack.js" - ], - "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] - }, - - "tooling": { - "defaultNamespace": "WebApplicationBasic" - } -} diff --git a/templates/ReactReduxSpa/template_gitignore b/templates/ReactReduxSpa/template_gitignore deleted file mode 100644 index d410b8bb..00000000 --- a/templates/ReactReduxSpa/template_gitignore +++ /dev/null @@ -1,237 +0,0 @@ -/Properties/launchSettings.json - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -bin/ -Bin/ -obj/ -Obj/ - -# Visual Studio 2015 cache/options directory -.vs/ -/wwwroot/dist/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Microsoft Azure ApplicationInsights config file -ApplicationInsights.config - -# Windows Store app package directory -AppPackages/ -BundleArtifacts/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe - -# FAKE - F# Make -.fake/ diff --git a/templates/ReactReduxSpa/tsconfig.json b/templates/ReactReduxSpa/tsconfig.json deleted file mode 100644 index b6603ac4..00000000 --- a/templates/ReactReduxSpa/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "node", - "target": "es6", - "jsx": "preserve", - "experimentalDecorators": true, - "sourceMap": true, - "skipDefaultLibCheck": true - }, - "exclude": [ - "node_modules" - ] -} diff --git a/templates/ReactReduxSpa/tsd.json b/templates/ReactReduxSpa/tsd.json deleted file mode 100644 index 6015daa5..00000000 --- a/templates/ReactReduxSpa/tsd.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "version": "v4", - "repo": "borisyankov/DefinitelyTyped", - "ref": "master", - "path": "typings", - "bundle": "typings/tsd.d.ts", - "installed": { - "react/react.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "react-router/react-router.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "react/react-dom.d.ts": { - "commit": "dade4414712ce84e3c63393f1aae407e9e7e6af7" - }, - "react-router/history.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "whatwg-fetch/whatwg-fetch.d.ts": { - "commit": "dade4414712ce84e3c63393f1aae407e9e7e6af7" - }, - "react-redux/react-redux.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "redux/redux.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "react-router-redux/react-router-redux.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "redux-thunk/redux-thunk.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "uglify-js/uglify-js.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "source-map/source-map.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - }, - "webpack/webpack-env.d.ts": { - "commit": "9f0f926a12026287b5a4a229e5672c01e7549313" - } - } -} diff --git a/templates/ReactReduxSpa/typings/react-redux/react-redux.d.ts b/templates/ReactReduxSpa/typings/react-redux/react-redux.d.ts deleted file mode 100644 index 9c46fd10..00000000 --- a/templates/ReactReduxSpa/typings/react-redux/react-redux.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -// Type definitions for react-redux 4.4.0 -// Project: https://github.com/rackt/react-redux -// Definitions by: Qubo -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module "react-redux" { - import { ComponentClass, Component, StatelessComponent } from 'react'; - import { Store, Dispatch, ActionCreator } from 'redux'; - - export interface ComponentConstructDecorator

    { - |StatelessComponent

    )>(component: TComponentConstruct): TComponentConstruct - } - - /** - * Connects a React component to a Redux store. - * @param mapStateToProps - * @param mapDispatchToProps - * @param mergeProps - * @param options - */ - export function connect

    (mapStateToProps?: MapStateToProps, - mapDispatchToProps?: MapDispatchToPropsFunction|MapDispatchToPropsObject, - mergeProps?: MergeProps, - options?: Options): ComponentConstructDecorator

    ; - - interface MapStateToProps { - (state: any, ownProps?: any): any; - } - - interface MapDispatchToPropsFunction { - (dispatch: Dispatch, ownProps?: any): any; - } - - interface MapDispatchToPropsObject { - [name: string]: ActionCreator; - } - - interface MergeProps { - (stateProps: any, dispatchProps: any, ownProps: any): any; - } - - interface Options { - /** - * If true, implements shouldComponentUpdate and shallowly compares the result of mergeProps, - * preventing unnecessary updates, assuming that the component is a “pure” component - * and does not rely on any input or state other than its props and the selected Redux store’s state. - * Defaults to true. - * @default true - */ - pure: boolean; - } - - export interface Property { - /** - * The single Redux store in your application. - */ - store?: Store; - children?: Function; - } - - /** - * Makes the Redux store available to the connect() calls in the component hierarchy below. - */ - export class Provider extends Component { } -} diff --git a/templates/ReactReduxSpa/typings/react-router-redux/react-router-redux.d.ts b/templates/ReactReduxSpa/typings/react-router-redux/react-router-redux.d.ts deleted file mode 100644 index 168161a1..00000000 --- a/templates/ReactReduxSpa/typings/react-router-redux/react-router-redux.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -// Type definitions for react-router-redux v4.0.0 -// Project: https://github.com/rackt/react-router-redux -// Definitions by: Isman Usoh , Noah Shipley , Dimitri Rosenberg -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare namespace ReactRouterRedux { - import R = Redux; - import H = HistoryModule; - - const CALL_HISTORY_METHOD: string; - const LOCATION_CHANGE: string; - - const push: PushAction; - const replace: ReplaceAction; - const go: GoAction; - const goBack: GoForwardAction; - const goForward: GoBackAction; - const routerActions: RouteActions; - - type LocationDescriptor = H.Location | H.Path; - type PushAction = (nextLocation: LocationDescriptor) => RouterAction; - type ReplaceAction = (nextLocation: LocationDescriptor) => RouterAction; - type GoAction = (n: number) => RouterAction; - type GoForwardAction = () => RouterAction; - type GoBackAction = () => RouterAction; - - type RouterAction = { - type: string - payload?: any - } - - interface RouteActions { - push: PushAction; - replace: ReplaceAction; - go: GoAction; - goForward: GoForwardAction; - goBack: GoBackAction; - } - interface ReactRouterReduxHistory extends H.History { - unsubscribe(): void; - } - - interface DefaultSelectLocationState extends Function { - (state: any): any; - } - - interface SyncHistoryWithStoreOptions { - selectLocationState?: DefaultSelectLocationState; - adjustUrlOnReplay?: boolean; - } - - function routerReducer(state?: any, options?: any): R.Reducer; - function syncHistoryWithStore(history: H.History, store: R.Store, options?: SyncHistoryWithStoreOptions): ReactRouterReduxHistory; - function routerMiddleware(history: H.History): R.Middleware; -} - -declare module "react-router-redux" { - export = ReactRouterRedux; -} diff --git a/templates/ReactReduxSpa/typings/react-router/history.d.ts b/templates/ReactReduxSpa/typings/react-router/history.d.ts deleted file mode 100644 index e22dbb75..00000000 --- a/templates/ReactReduxSpa/typings/react-router/history.d.ts +++ /dev/null @@ -1,233 +0,0 @@ -// Type definitions for history v2.0.0 -// Project: https://github.com/rackt/history -// Definitions by: Sergey Buturlakin , Nathan Brown -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -declare namespace HistoryModule { - - // types based on https://github.com/rackt/history/blob/master/docs/Terms.md - - type Action = string - - type BeforeUnloadHook = () => string | boolean - - type CreateHistory = (options?: HistoryOptions) => T - - type CreateHistoryEnhancer = (createHistory: CreateHistory) => CreateHistory - - interface History { - listenBefore(hook: TransitionHook): () => void - listen(listener: LocationListener): () => void - transitionTo(location: Location): void - push(path: LocationDescriptor): void - replace(path: LocationDescriptor): void - go(n: number): void - goBack(): void - goForward(): void - createKey(): LocationKey - createPath(path: LocationDescriptor): Path - createHref(path: LocationDescriptor): Href - createLocation(path?: LocationDescriptor, action?: Action, key?: LocationKey): Location - - /** @deprecated use a location descriptor instead */ - createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location - /** @deprecated use location.key to save state instead */ - pushState(state: LocationState, path: Path): void - /** @deprecated use location.key to save state instead */ - replaceState(state: LocationState, path: Path): void - /** @deprecated use location.key to save state instead */ - setState(state: LocationState): void - /** @deprecated use listenBefore instead */ - registerTransitionHook(hook: TransitionHook): void - /** @deprecated use the callback returned from listenBefore instead */ - unregisterTransitionHook(hook: TransitionHook): void - } - - type HistoryOptions = { - getCurrentLocation?: () => Location - finishTransition?: (nextLocation: Location) => boolean - saveState?: (key: LocationKey, state: LocationState) => void - go?: (n: number) => void - getUserConfirmation?: (message: string, callback: (result: boolean) => void) => void - keyLength?: number - queryKey?: string | boolean - stringifyQuery?: (obj: any) => string - parseQueryString?: (str: string) => any - basename?: string - entries?: string | [any] - current?: number - } - - type Href = string - - type Location = { - pathname: Pathname - search: Search - query: Query - state: LocationState - action: Action - key: LocationKey - basename?: string - } - - type LocationDescriptorObject = { - pathname?: Pathname - search?: Search - query?: Query - state?: LocationState - } - - type LocationDescriptor = LocationDescriptorObject | Path - - type LocationKey = string - - type LocationListener = (location: Location) => void - - type LocationState = Object - - type Path = string // Pathname + QueryString - - type Pathname = string - - type Query = Object - - type QueryString = string - - type Search = string - - type TransitionHook = (location: Location, callback: (result: any) => void) => any - - - interface HistoryBeforeUnload { - listenBeforeUnload(hook: BeforeUnloadHook): () => void - } - - interface HistoryQueries { - pushState(state: LocationState, pathname: Pathname | Path, query?: Query): void - replaceState(state: LocationState, pathname: Pathname | Path, query?: Query): void - createPath(path: Path, query?: Query): Path - createHref(path: Path, query?: Query): Href - } - - - // Global usage, without modules, needs the small trick, because lib.d.ts - // already has `history` and `History` global definitions: - // var createHistory = ((window as any).History as HistoryModule.Module).createHistory; - interface Module { - createHistory: CreateHistory - createHashHistory: CreateHistory - createMemoryHistory: CreateHistory - createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location - useBasename(createHistory: CreateHistory): CreateHistory - useBeforeUnload(createHistory: CreateHistory): CreateHistory - useQueries(createHistory: CreateHistory): CreateHistory - actions: { - PUSH: string - REPLACE: string - POP: string - } - } - -} - - -declare module "history/lib/createBrowserHistory" { - - export default function createBrowserHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History - -} - - -declare module "history/lib/createHashHistory" { - - export default function createHashHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History - -} - - -declare module "history/lib/createMemoryHistory" { - - export default function createMemoryHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History - -} - - -declare module "history/lib/createLocation" { - - export default function createLocation(path?: HistoryModule.Path, state?: HistoryModule.LocationState, action?: HistoryModule.Action, key?: HistoryModule.LocationKey): HistoryModule.Location - -} - - -declare module "history/lib/useBasename" { - - export default function useBasename(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory - -} - - -declare module "history/lib/useBeforeUnload" { - - export default function useBeforeUnload(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory - -} - - -declare module "history/lib/useQueries" { - - export default function useQueries(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory - -} - - -declare module "history/lib/actions" { - - export const PUSH: string - - export const REPLACE: string - - export const POP: string - - export default { - PUSH, - REPLACE, - POP - } - -} - -declare module "history/lib/DOMUtils" { - export function addEventListener(node: EventTarget, event: string, listener: EventListenerOrEventListenerObject): void; - export function removeEventListener(node: EventTarget, event: string, listener: EventListenerOrEventListenerObject): void; - export function getHashPath(): string; - export function replaceHashPath(path: string): void; - export function getWindowPath(): string; - export function go(n: number): void; - export function getUserConfirmation(message: string, callback: (result: boolean) => void): void; - export function supportsHistory(): boolean; - export function supportsGoWithoutReloadUsingHash(): boolean; -} - - -declare module "history" { - - export { default as createHistory } from "history/lib/createBrowserHistory" - - export { default as createHashHistory } from "history/lib/createHashHistory" - - export { default as createMemoryHistory } from "history/lib/createMemoryHistory" - - export { default as createLocation } from "history/lib/createLocation" - - export { default as useBasename } from "history/lib/useBasename" - - export { default as useBeforeUnload } from "history/lib/useBeforeUnload" - - export { default as useQueries } from "history/lib/useQueries" - - import * as Actions from "history/lib/actions" - - export { Actions } - -} diff --git a/templates/ReactReduxSpa/typings/react-router/react-router.d.ts b/templates/ReactReduxSpa/typings/react-router/react-router.d.ts deleted file mode 100644 index e87622e9..00000000 --- a/templates/ReactReduxSpa/typings/react-router/react-router.d.ts +++ /dev/null @@ -1,480 +0,0 @@ -// Type definitions for react-router v2.0.0 -// Project: https://github.com/rackt/react-router -// Definitions by: Sergey Buturlakin , Yuichi Murata , Václav Ostrožlík , Nathan Brown -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -/// -/// - - -declare namespace ReactRouter { - - import React = __React - - import H = HistoryModule - - // types based on https://github.com/rackt/react-router/blob/master/docs/Glossary.md - - type Component = React.ReactType - - type EnterHook = (nextState: RouterState, replaceState: RedirectFunction, callback?: Function) => any - - type LeaveHook = () => any - - type Params = Object - - type ParseQueryString = (queryString: H.QueryString) => H.Query - - type RedirectFunction = (state: H.LocationState, pathname: H.Pathname | H.Path, query?: H.Query) => void - - type RouteComponent = Component - - // use the following interface in an app code to get access to route param values, history, location... - // interface MyComponentProps extends ReactRouter.RouteComponentProps<{}, { id: number }> {} - // somewhere in MyComponent - // ... - // let id = this.props.routeParams.id - // ... - // this.props.history. ... - // ... - interface RouteComponentProps { - history?: History - location?: H.Location - params?: P - route?: PlainRoute - routeParams?: R - routes?: PlainRoute[] - children?: React.ReactElement - } - - type RouteComponents = { [key: string]: RouteComponent } - - type RouteConfig = React.ReactNode | PlainRoute | PlainRoute[] - - type RouteHook = (nextLocation?: H.Location) => any - - type RoutePattern = string - - type StringifyQuery = (queryObject: H.Query) => H.QueryString - - type RouterListener = (error: Error, nextState: RouterState) => void - - interface RouterState { - location: H.Location - routes: PlainRoute[] - params: Params - components: RouteComponent[] - } - - - interface HistoryBase extends H.History { - routes: PlainRoute[] - parseQueryString?: ParseQueryString - stringifyQuery?: StringifyQuery - } - - type History = HistoryBase & H.HistoryQueries & HistoryRoutes - const browserHistory: History; - const hashHistory: History; - - /* components */ - - interface RouterProps extends React.Props { - history?: H.History - routes?: RouteConfig // alias for children - createElement?: (component: RouteComponent, props: Object) => any - onError?: (error: any) => any - onUpdate?: () => any - parseQueryString?: ParseQueryString - stringifyQuery?: StringifyQuery - } - interface Router extends React.ComponentClass {} - interface RouterElement extends React.ReactElement {} - const Router: Router - - - interface LinkProps extends React.HTMLAttributes, React.Props { - activeStyle?: React.CSSProperties - activeClassName?: string - onlyActiveOnIndex?: boolean - to: RoutePattern - query?: H.Query - state?: H.LocationState - } - interface Link extends React.ComponentClass {} - interface LinkElement extends React.ReactElement {} - const Link: Link - - - const IndexLink: Link - - - interface RouterContextProps extends React.Props { - history?: H.History - router: Router - createElement: (component: RouteComponent, props: Object) => any - location: H.Location - routes: RouteConfig - params: Params - components?: RouteComponent[] - } - interface RouterContext extends React.ComponentClass {} - interface RouterContextElement extends React.ReactElement { - history?: H.History - location: H.Location - router?: Router - } - const RouterContext: RouterContext - - - /* components (configuration) */ - - interface RouteProps extends React.Props { - path?: RoutePattern - component?: RouteComponent - components?: RouteComponents - getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void - getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void - onEnter?: EnterHook - onLeave?: LeaveHook - getIndexRoute?: (location: H.Location, cb: (error: any, indexRoute: RouteConfig) => void) => void - getChildRoutes?: (location: H.Location, cb: (error: any, childRoutes: RouteConfig) => void) => void - } - interface Route extends React.ComponentClass {} - interface RouteElement extends React.ReactElement {} - const Route: Route - - - interface PlainRoute { - path?: RoutePattern - component?: RouteComponent - components?: RouteComponents - getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void - getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void - onEnter?: EnterHook - onLeave?: LeaveHook - indexRoute?: PlainRoute - getIndexRoute?: (location: H.Location, cb: (error: any, indexRoute: RouteConfig) => void) => void - childRoutes?: PlainRoute[] - getChildRoutes?: (location: H.Location, cb: (error: any, childRoutes: RouteConfig) => void) => void - } - - - interface RedirectProps extends React.Props { - path?: RoutePattern - from?: RoutePattern // alias for path - to: RoutePattern - query?: H.Query - state?: H.LocationState - } - interface Redirect extends React.ComponentClass {} - interface RedirectElement extends React.ReactElement {} - const Redirect: Redirect - - - interface IndexRouteProps extends React.Props { - component?: RouteComponent - components?: RouteComponents - getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void - getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void - onEnter?: EnterHook - onLeave?: LeaveHook - } - interface IndexRoute extends React.ComponentClass {} - interface IndexRouteElement extends React.ReactElement {} - const IndexRoute: IndexRoute - - - interface IndexRedirectProps extends React.Props { - to: RoutePattern - query?: H.Query - state?: H.LocationState - } - interface IndexRedirect extends React.ComponentClass {} - interface IndexRedirectElement extends React.ReactElement {} - const IndexRedirect: IndexRedirect - - interface RouterOnContext extends H.History { - setRouteLeaveHook(route: PlainRoute, hook?: RouteHook): () => void; - isActive(pathOrLoc: H.LocationDescriptor, indexOnly?: boolean): boolean; - } - - /* mixins */ - - interface HistoryMixin { - history: History - } - const History: React.Mixin - - - interface LifecycleMixin { - routerWillLeave(nextLocation: H.Location): string | boolean - } - const Lifecycle: React.Mixin - - - const RouteContext: React.Mixin - - - /* utils */ - - interface HistoryRoutes { - listen(listener: RouterListener): Function - listenBeforeLeavingRoute(route: PlainRoute, hook: RouteHook): void - match(location: H.Location, callback: (error: any, nextState: RouterState, nextLocation: H.Location) => void): void - isActive(pathname: H.Pathname, query?: H.Query, indexOnly?: boolean): boolean - setRouteLeaveHook(route: PlainRoute, callback: RouteHook): void - } - - function useRoutes(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory - - - function createRoutes(routes: RouteConfig): PlainRoute[] - - - interface MatchArgs { - routes?: RouteConfig - history?: H.History - location?: H.Location - parseQueryString?: ParseQueryString - stringifyQuery?: StringifyQuery - } - interface MatchState extends RouterState { - history: History - } - function match(args: MatchArgs, cb: (error: any, nextLocation: H.Location, nextState: MatchState) => void): void - -} - - -declare module "react-router/lib/Router" { - - export default ReactRouter.Router - -} - - -declare module "react-router/lib/Link" { - - export default ReactRouter.Link - -} - - -declare module "react-router/lib/IndexLink" { - - export default ReactRouter.IndexLink - -} - - -declare module "react-router/lib/IndexRedirect" { - - export default ReactRouter.IndexRedirect - -} - - -declare module "react-router/lib/IndexRoute" { - - export default ReactRouter.IndexRoute - -} - - -declare module "react-router/lib/Redirect" { - - export default ReactRouter.Redirect - -} - - -declare module "react-router/lib/Route" { - - export default ReactRouter.Route - -} - - -declare module "react-router/lib/History" { - - export default ReactRouter.History - -} - - -declare module "react-router/lib/Lifecycle" { - - export default ReactRouter.Lifecycle - -} - - -declare module "react-router/lib/RouteContext" { - - export default ReactRouter.RouteContext - -} - - -declare module "react-router/lib/useRoutes" { - - export default ReactRouter.useRoutes - -} - -declare module "react-router/lib/PatternUtils" { - - export function formatPattern(pattern: string, params: {}): string; - -} - -declare module "react-router/lib/RouteUtils" { - - type E = __React.ReactElement - - export function isReactChildren(object: E | E[]): boolean - - export function createRouteFromReactElement(element: E): ReactRouter.PlainRoute - - export function createRoutesFromReactChildren(children: E | E[], parentRoute: ReactRouter.PlainRoute): ReactRouter.PlainRoute[] - - export import createRoutes = ReactRouter.createRoutes - -} - - -declare module "react-router/lib/RouterContext" { - - export default ReactRouter.RouterContext - -} - - -declare module "react-router/lib/PropTypes" { - - import React = __React - - export function falsy(props: any, propName: string, componentName: string): Error; - - export const history: React.Requireable - - export const location: React.Requireable - - export const component: React.Requireable - - export const components: React.Requireable - - export const route: React.Requireable - - export const routes: React.Requireable - - export default { - falsy, - history, - location, - component, - components, - route - } - -} - -declare module "react-router/lib/browserHistory" { - export default ReactRouter.browserHistory; -} - -declare module "react-router/lib/hashHistory" { - export default ReactRouter.hashHistory; -} - -declare module "react-router/lib/match" { - - export default ReactRouter.match - -} - - -declare module "react-router" { - - import Router from "react-router/lib/Router" - - import Link from "react-router/lib/Link" - - import IndexLink from "react-router/lib/IndexLink" - - import IndexRedirect from "react-router/lib/IndexRedirect" - - import IndexRoute from "react-router/lib/IndexRoute" - - import Redirect from "react-router/lib/Redirect" - - import Route from "react-router/lib/Route" - - import History from "react-router/lib/History" - - import Lifecycle from "react-router/lib/Lifecycle" - - import RouteContext from "react-router/lib/RouteContext" - - import browserHistory from "react-router/lib/browserHistory" - - import hashHistory from "react-router/lib/hashHistory" - - import useRoutes from "react-router/lib/useRoutes" - - import { createRoutes } from "react-router/lib/RouteUtils" - - import { formatPattern } from "react-router/lib/PatternUtils" - - import RouterContext from "react-router/lib/RouterContext" - - import PropTypes from "react-router/lib/PropTypes" - - import match from "react-router/lib/match" - - // PlainRoute is defined in the API documented at: - // https://github.com/rackt/react-router/blob/master/docs/API.md - // but not included in any of the .../lib modules above. - export type PlainRoute = ReactRouter.PlainRoute - - // The following definitions are also very useful to export - // because by using these types lots of potential type errors - // can be exposed: - export type EnterHook = ReactRouter.EnterHook - export type LeaveHook = ReactRouter.LeaveHook - export type ParseQueryString = ReactRouter.ParseQueryString - export type RedirectFunction = ReactRouter.RedirectFunction - export type RouteComponentProps = ReactRouter.RouteComponentProps; - export type RouteHook = ReactRouter.RouteHook - export type StringifyQuery = ReactRouter.StringifyQuery - export type RouterListener = ReactRouter.RouterListener - export type RouterState = ReactRouter.RouterState - export type HistoryBase = ReactRouter.HistoryBase - export type RouterOnContext = ReactRouter.RouterOnContext - - export { - Router, - Link, - IndexLink, - IndexRedirect, - IndexRoute, - Redirect, - Route, - History, - browserHistory, - hashHistory, - Lifecycle, - RouteContext, - useRoutes, - createRoutes, - formatPattern, - RouterContext, - PropTypes, - match - } - - export default Router - -} diff --git a/templates/ReactReduxSpa/typings/react/react-dom.d.ts b/templates/ReactReduxSpa/typings/react/react-dom.d.ts deleted file mode 100644 index 80a0c604..00000000 --- a/templates/ReactReduxSpa/typings/react/react-dom.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Type definitions for React v0.14 (react-dom) -// Project: http://facebook.github.io/react/ -// Definitions by: Asana , AssureSign , Microsoft -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare namespace __React { - namespace __DOM { - function findDOMNode(instance: ReactInstance): E; - function findDOMNode(instance: ReactInstance): Element; - - function render

    ( - element: DOMElement

    , - container: Element, - callback?: (element: Element) => any): Element; - function render( - element: ClassicElement

    , - container: Element, - callback?: (component: ClassicComponent) => any): ClassicComponent; - function render( - element: ReactElement

    , - container: Element, - callback?: (component: Component) => any): Component; - - function unmountComponentAtNode(container: Element): boolean; - - var version: string; - - function unstable_batchedUpdates(callback: (a: A, b: B) => any, a: A, b: B): void; - function unstable_batchedUpdates(callback: (a: A) => any, a: A): void; - function unstable_batchedUpdates(callback: () => any): void; - - function unstable_renderSubtreeIntoContainer

    ( - parentComponent: Component, - nextElement: DOMElement

    , - container: Element, - callback?: (element: Element) => any): Element; - function unstable_renderSubtreeIntoContainer( - parentComponent: Component, - nextElement: ClassicElement

    , - container: Element, - callback?: (component: ClassicComponent) => any): ClassicComponent; - function unstable_renderSubtreeIntoContainer( - parentComponent: Component, - nextElement: ReactElement

    , - container: Element, - callback?: (component: Component) => any): Component; - } - - namespace __DOMServer { - function renderToString(element: ReactElement): string; - function renderToStaticMarkup(element: ReactElement): string; - var version: string; - } -} - -declare module "react-dom" { - import DOM = __React.__DOM; - export = DOM; -} - -declare module "react-dom/server" { - import DOMServer = __React.__DOMServer; - export = DOMServer; -} diff --git a/templates/ReactReduxSpa/typings/react/react.d.ts b/templates/ReactReduxSpa/typings/react/react.d.ts deleted file mode 100644 index f4369e4a..00000000 --- a/templates/ReactReduxSpa/typings/react/react.d.ts +++ /dev/null @@ -1,2405 +0,0 @@ -// Type definitions for React v0.14 -// Project: http://facebook.github.io/react/ -// Definitions by: Asana , AssureSign , Microsoft -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare namespace __React { - - // - // React Elements - // ---------------------------------------------------------------------- - - type ReactType = string | ComponentClass | StatelessComponent; - type Key = string | number; - type Ref = string | ((instance: T) => any); - - interface ReactElement

    > { - type: string | ComponentClass

    | StatelessComponent

    ; - props: P; - key: Key; - ref: Ref | Element>; - } - - interface ClassicElement

    extends ReactElement

    { - type: ClassicComponentClass

    ; - ref: Ref>; - } - - interface DOMElement

    > extends ReactElement

    { - type: string; - ref: Ref; - } - - interface ReactHTMLElement extends DOMElement> { - ref: Ref; - } - - interface ReactSVGElement extends DOMElement { - ref: Ref; - } - - // - // Factories - // ---------------------------------------------------------------------- - - interface Factory

    { - (props?: P, ...children: ReactNode[]): ReactElement

    ; - } - - interface ClassicFactory

    extends Factory

    { - (props?: P, ...children: ReactNode[]): ClassicElement

    ; - } - - interface DOMFactory

    > extends Factory

    { - (props?: P, ...children: ReactNode[]): DOMElement

    ; - } - - type HTMLFactory = DOMFactory>; - type SVGFactory = DOMFactory; - - // - // React Nodes - // http://facebook.github.io/react/docs/glossary.html - // ---------------------------------------------------------------------- - - type ReactText = string | number; - type ReactChild = ReactElement | ReactText; - - // Should be Array but type aliases cannot be recursive - type ReactFragment = {} | Array; - type ReactNode = ReactChild | ReactFragment | boolean; - - // - // Top Level API - // ---------------------------------------------------------------------- - - function createClass(spec: ComponentSpec): ClassicComponentClass

    ; - - function createFactory

    (type: string): DOMFactory

    ; - function createFactory

    (type: ClassicComponentClass

    ): ClassicFactory

    ; - function createFactory

    (type: ComponentClass

    | StatelessComponent

    ): Factory

    ; - - function createElement

    ( - type: string, - props?: P, - ...children: ReactNode[]): DOMElement

    ; - function createElement

    ( - type: ClassicComponentClass

    , - props?: P, - ...children: ReactNode[]): ClassicElement

    ; - function createElement

    ( - type: ComponentClass

    | StatelessComponent

    , - props?: P, - ...children: ReactNode[]): ReactElement

    ; - - function cloneElement( - element: ReactHTMLElement, - props?: HTMLProps, - ...children: ReactNode[]): ReactHTMLElement; - function cloneElement( - element: ReactSVGElement, - props?: SVGProps, - ...children: ReactNode[]): ReactSVGElement; - function cloneElement

    ( - element: ClassicElement

    , - props?: Q, - ...children: ReactNode[]): ClassicElement

    ; - function cloneElement

    ( - element: ReactElement

    , - props?: Q, - ...children: ReactNode[]): ReactElement

    ; - - function isValidElement(object: {}): boolean; - - var DOM: ReactDOM; - var PropTypes: ReactPropTypes; - var Children: ReactChildren; - - // - // Component API - // ---------------------------------------------------------------------- - - type ReactInstance = Component | Element; - - // Base component for plain JS classes - class Component implements ComponentLifecycle { - constructor(props?: P, context?: any); - setState(f: (prevState: S, props: P) => S, callback?: () => any): void; - setState(state: S, callback?: () => any): void; - forceUpdate(callBack?: () => any): void; - render(): JSX.Element; - props: P; - state: S; - context: {}; - refs: { - [key: string]: ReactInstance - }; - } - - interface ClassicComponent extends Component { - replaceState(nextState: S, callback?: () => any): void; - isMounted(): boolean; - getInitialState?(): S; - } - - interface ChildContextProvider { - getChildContext(): CC; - } - - // - // Class Interfaces - // ---------------------------------------------------------------------- - - interface StatelessComponent

    { - (props?: P, context?: any): ReactElement; - propTypes?: ValidationMap

    ; - contextTypes?: ValidationMap; - defaultProps?: P; - displayName?: string; - } - - interface ComponentClass

    { - new(props?: P, context?: any): Component; - propTypes?: ValidationMap

    ; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap; - defaultProps?: P; - } - - interface ClassicComponentClass

    extends ComponentClass

    { - new(props?: P, context?: any): ClassicComponent; - getDefaultProps?(): P; - displayName?: string; - } - - // - // Component Specs and Lifecycle - // ---------------------------------------------------------------------- - - interface ComponentLifecycle { - componentWillMount?(): void; - componentDidMount?(): void; - componentWillReceiveProps?(nextProps: P, nextContext: any): void; - shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; - componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; - componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; - componentWillUnmount?(): void; - } - - interface Mixin extends ComponentLifecycle { - mixins?: Mixin; - statics?: { - [key: string]: any; - }; - - displayName?: string; - propTypes?: ValidationMap; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap; - - getDefaultProps?(): P; - getInitialState?(): S; - } - - interface ComponentSpec extends Mixin { - render(): ReactElement; - - [propertyName: string]: any; - } - - // - // Event System - // ---------------------------------------------------------------------- - - interface SyntheticEvent { - bubbles: boolean; - cancelable: boolean; - currentTarget: EventTarget; - defaultPrevented: boolean; - eventPhase: number; - isTrusted: boolean; - nativeEvent: Event; - preventDefault(): void; - stopPropagation(): void; - target: EventTarget; - timeStamp: Date; - type: string; - } - - interface ClipboardEvent extends SyntheticEvent { - clipboardData: DataTransfer; - } - - interface CompositionEvent extends SyntheticEvent { - data: string; - } - - interface DragEvent extends SyntheticEvent { - dataTransfer: DataTransfer; - } - - interface FocusEvent extends SyntheticEvent { - relatedTarget: EventTarget; - } - - interface FormEvent extends SyntheticEvent { - } - - interface KeyboardEvent extends SyntheticEvent { - altKey: boolean; - charCode: number; - ctrlKey: boolean; - getModifierState(key: string): boolean; - key: string; - keyCode: number; - locale: string; - location: number; - metaKey: boolean; - repeat: boolean; - shiftKey: boolean; - which: number; - } - - interface MouseEvent extends SyntheticEvent { - altKey: boolean; - button: number; - buttons: number; - clientX: number; - clientY: number; - ctrlKey: boolean; - getModifierState(key: string): boolean; - metaKey: boolean; - pageX: number; - pageY: number; - relatedTarget: EventTarget; - screenX: number; - screenY: number; - shiftKey: boolean; - } - - interface TouchEvent extends SyntheticEvent { - altKey: boolean; - changedTouches: TouchList; - ctrlKey: boolean; - getModifierState(key: string): boolean; - metaKey: boolean; - shiftKey: boolean; - targetTouches: TouchList; - touches: TouchList; - } - - interface UIEvent extends SyntheticEvent { - detail: number; - view: AbstractView; - } - - interface WheelEvent extends SyntheticEvent { - deltaMode: number; - deltaX: number; - deltaY: number; - deltaZ: number; - } - - // - // Event Handler Types - // ---------------------------------------------------------------------- - - interface EventHandler { - (event: E): void; - } - - type ReactEventHandler = EventHandler; - - type ClipboardEventHandler = EventHandler; - type CompositionEventHandler = EventHandler; - type DragEventHandler = EventHandler; - type FocusEventHandler = EventHandler; - type FormEventHandler = EventHandler; - type KeyboardEventHandler = EventHandler; - type MouseEventHandler = EventHandler; - type TouchEventHandler = EventHandler; - type UIEventHandler = EventHandler; - type WheelEventHandler = EventHandler; - - // - // Props / DOM Attributes - // ---------------------------------------------------------------------- - - interface Props { - children?: ReactNode; - key?: Key; - ref?: Ref; - } - - interface HTMLProps extends HTMLAttributes, Props { - } - - interface SVGProps extends SVGAttributes, Props { - } - - interface DOMAttributes { - dangerouslySetInnerHTML?: { - __html: string; - }; - - // Clipboard Events - onCopy?: ClipboardEventHandler; - onCut?: ClipboardEventHandler; - onPaste?: ClipboardEventHandler; - - // Composition Events - onCompositionEnd?: CompositionEventHandler; - onCompositionStart?: CompositionEventHandler; - onCompositionUpdate?: CompositionEventHandler; - - // Focus Events - onFocus?: FocusEventHandler; - onBlur?: FocusEventHandler; - - // Form Events - onChange?: FormEventHandler; - onInput?: FormEventHandler; - onSubmit?: FormEventHandler; - - // Image Events - onLoad?: ReactEventHandler; - onError?: ReactEventHandler; // also a Media Event - - // Keyboard Events - onKeyDown?: KeyboardEventHandler; - onKeyPress?: KeyboardEventHandler; - onKeyUp?: KeyboardEventHandler; - - // Media Events - onAbort?: ReactEventHandler; - onCanPlay?: ReactEventHandler; - onCanPlayThrough?: ReactEventHandler; - onDurationChange?: ReactEventHandler; - onEmptied?: ReactEventHandler; - onEncrypted?: ReactEventHandler; - onEnded?: ReactEventHandler; - onLoadedData?: ReactEventHandler; - onLoadedMetadata?: ReactEventHandler; - onLoadStart?: ReactEventHandler; - onPause?: ReactEventHandler; - onPlay?: ReactEventHandler; - onPlaying?: ReactEventHandler; - onProgress?: ReactEventHandler; - onRateChange?: ReactEventHandler; - onSeeked?: ReactEventHandler; - onSeeking?: ReactEventHandler; - onStalled?: ReactEventHandler; - onSuspend?: ReactEventHandler; - onTimeUpdate?: ReactEventHandler; - onVolumeChange?: ReactEventHandler; - onWaiting?: ReactEventHandler; - - // MouseEvents - onClick?: MouseEventHandler; - onContextMenu?: MouseEventHandler; - onDoubleClick?: MouseEventHandler; - onDrag?: DragEventHandler; - onDragEnd?: DragEventHandler; - onDragEnter?: DragEventHandler; - onDragExit?: DragEventHandler; - onDragLeave?: DragEventHandler; - onDragOver?: DragEventHandler; - onDragStart?: DragEventHandler; - onDrop?: DragEventHandler; - onMouseDown?: MouseEventHandler; - onMouseEnter?: MouseEventHandler; - onMouseLeave?: MouseEventHandler; - onMouseMove?: MouseEventHandler; - onMouseOut?: MouseEventHandler; - onMouseOver?: MouseEventHandler; - onMouseUp?: MouseEventHandler; - - // Selection Events - onSelect?: ReactEventHandler; - - // Touch Events - onTouchCancel?: TouchEventHandler; - onTouchEnd?: TouchEventHandler; - onTouchMove?: TouchEventHandler; - onTouchStart?: TouchEventHandler; - - // UI Events - onScroll?: UIEventHandler; - - // Wheel Events - onWheel?: WheelEventHandler; - } - - // This interface is not complete. Only properties accepting - // unitless numbers are listed here (see CSSProperty.js in React) - interface CSSProperties { - - /** - * Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis. - */ - alignContent?: any; - - /** - * Sets the default alignment in the cross axis for all of the flex container's items, including anonymous flex items, similarly to how justify-content aligns items along the main axis. - */ - alignItems?: any; - - /** - * Allows the default alignment to be overridden for individual flex items. - */ - alignSelf?: any; - - /** - * This property allows precise alignment of elements, such as graphics, that do not have a baseline-table or lack the desired baseline in their baseline-table. With the alignment-adjust property, the position of the baseline identified by the alignment-baseline can be explicitly determined. It also determines precisely the alignment point for each glyph within a textual element. - */ - alignmentAdjust?: any; - - alignmentBaseline?: any; - - /** - * Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied. - */ - animationDelay?: any; - - /** - * Defines whether an animation should run in reverse on some or all cycles. - */ - animationDirection?: any; - - /** - * Specifies how many times an animation cycle should play. - */ - animationIterationCount?: any; - - /** - * Defines the list of animations that apply to the element. - */ - animationName?: any; - - /** - * Defines whether an animation is running or paused. - */ - animationPlayState?: any; - - /** - * Allows changing the style of any element to platform-based interface elements or vice versa. - */ - appearance?: any; - - /** - * Determines whether or not the “back” side of a transformed element is visible when facing the viewer. - */ - backfaceVisibility?: any; - - /** - * Shorthand property to set the values for one or more of: - * background-clip, background-color, background-image, - * background-origin, background-position, background-repeat, - * background-size, and background-attachment. - */ - background?: any; - - /** - * If a background-image is specified, this property determines - * whether that image's position is fixed within the viewport, - * or scrolls along with its containing block. - */ - backgroundAttachment?: "scroll" | "fixed" | "local"; - - /** - * This property describes how the element's background images should blend with each other and the element's background color. - * The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the corresponding element of background-image. If a property doesn’t have enough comma-separated values to match the number of layers, the UA must calculate its used value by repeating the list of values until there are enough. - */ - backgroundBlendMode?: any; - - /** - * Sets the background color of an element. - */ - backgroundColor?: any; - - backgroundComposite?: any; - - /** - * Applies one or more background images to an element. These can be any valid CSS image, including url() paths to image files or CSS gradients. - */ - backgroundImage?: any; - - /** - * Specifies what the background-position property is relative to. - */ - backgroundOrigin?: any; - - /** - * Sets the position of a background image. - */ - backgroundPosition?: any; - - /** - * Background-repeat defines if and how background images will be repeated after they have been sized and positioned - */ - backgroundRepeat?: any; - - /** - * Obsolete - spec retired, not implemented. - */ - baselineShift?: any; - - /** - * Non standard. Sets or retrieves the location of the Dynamic HTML (DHTML) behavior. - */ - behavior?: any; - - /** - * Shorthand property that defines the different properties of all four sides of an element's border in a single declaration. It can be used to set border-width, border-style and border-color, or a subset of these. - */ - border?: any; - - /** - * Shorthand that sets the values of border-bottom-color, - * border-bottom-style, and border-bottom-width. - */ - borderBottom?: any; - - /** - * Sets the color of the bottom border of an element. - */ - borderBottomColor?: any; - - /** - * Defines the shape of the border of the bottom-left corner. - */ - borderBottomLeftRadius?: any; - - /** - * Defines the shape of the border of the bottom-right corner. - */ - borderBottomRightRadius?: any; - - /** - * Sets the line style of the bottom border of a box. - */ - borderBottomStyle?: any; - - /** - * Sets the width of an element's bottom border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - */ - borderBottomWidth?: any; - - /** - * Border-collapse can be used for collapsing the borders between table cells - */ - borderCollapse?: any; - - /** - * The CSS border-color property sets the color of an element's four borders. This property can have from one to four values, made up of the elementary properties: • border-top-color - * • border-right-color - * • border-bottom-color - * • border-left-color The default color is the currentColor of each of these values. - * If you provide one value, it sets the color for the element. Two values set the horizontal and vertical values, respectively. Providing three values sets the top, vertical, and bottom values, in that order. Four values set all for sides: top, right, bottom, and left, in that order. - */ - borderColor?: any; - - /** - * Specifies different corner clipping effects, such as scoop (inner curves), bevel (straight cuts) or notch (cut-off rectangles). Works along with border-radius to specify the size of each corner effect. - */ - borderCornerShape?: any; - - /** - * The property border-image-source is used to set the image to be used instead of the border style. If this is set to none the border-style is used instead. - */ - borderImageSource?: any; - - /** - * The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges. - */ - borderImageWidth?: any; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's left border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the left border — border-left-width, border-left-style and border-left-color. - */ - borderLeft?: any; - - /** - * The CSS border-left-color property sets the color of an element's left border. This page explains the border-left-color value, but often you will find it more convenient to fix the border's left color as part of a shorthand set, either border-left or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - borderLeftColor?: any; - - /** - * Sets the style of an element's left border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - */ - borderLeftStyle?: any; - - /** - * Sets the width of an element's left border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - */ - borderLeftWidth?: any; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's right border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the right border — border-right-width, border-right-style and border-right-color. - */ - borderRight?: any; - - /** - * Sets the color of an element's right border. This page explains the border-right-color value, but often you will find it more convenient to fix the border's right color as part of a shorthand set, either border-right or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - borderRightColor?: any; - - /** - * Sets the style of an element's right border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - */ - borderRightStyle?: any; - - /** - * Sets the width of an element's right border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - */ - borderRightWidth?: any; - - /** - * Specifies the distance between the borders of adjacent cells. - */ - borderSpacing?: any; - - /** - * Sets the style of an element's four borders. This property can have from one to four values. With only one value, the value will be applied to all four borders; otherwise, this works as a shorthand property for each of border-top-style, border-right-style, border-bottom-style, border-left-style, where each border style may be assigned a separate value. - */ - borderStyle?: any; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's top border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the top border — border-top-width, border-top-style and border-top-color. - */ - borderTop?: any; - - /** - * Sets the color of an element's top border. This page explains the border-top-color value, but often you will find it more convenient to fix the border's top color as part of a shorthand set, either border-top or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - borderTopColor?: any; - - /** - * Sets the rounding of the top-left corner of the element. - */ - borderTopLeftRadius?: any; - - /** - * Sets the rounding of the top-right corner of the element. - */ - borderTopRightRadius?: any; - - /** - * Sets the style of an element's top border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - */ - borderTopStyle?: any; - - /** - * Sets the width of an element's top border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - */ - borderTopWidth?: any; - - /** - * Sets the width of an element's four borders. This property can have from one to four values. This is a shorthand property for setting values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - */ - borderWidth?: any; - - /** - * This property specifies how far an absolutely positioned box's bottom margin edge is offset above the bottom edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the bottom edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). - */ - bottom?: any; - - /** - * Obsolete. - */ - boxAlign?: any; - - /** - * Breaks a box into fragments creating new borders, padding and repeating backgrounds or lets it stay as a continuous box on a page break, column break, or, for inline elements, at a line break. - */ - boxDecorationBreak?: any; - - /** - * Deprecated - */ - boxDirection?: any; - - /** - * Do not use. This property has been replaced by the flex-wrap property. - * Gets or sets a value that specifies the direction to add successive rows or columns when the value of box-lines is set to multiple. - */ - boxLineProgression?: any; - - /** - * Do not use. This property has been replaced by the flex-wrap property. - * Gets or sets a value that specifies whether child elements wrap onto multiple lines or columns based on the space available in the object. - */ - boxLines?: any; - - /** - * Do not use. This property has been replaced by flex-order. - * Specifies the ordinal group that a child element of the object belongs to. This ordinal value identifies the display order (along the axis defined by the box-orient property) for the group. - */ - boxOrdinalGroup?: any; - - /** - * Deprecated. - */ - boxFlex?: number; - - /** - * Deprecated. - */ - boxFlexGroup?: number; - - /** - * The CSS break-after property allows you to force a break on multi-column layouts. More specifically, it allows you to force a break after an element. It allows you to determine if a break should occur, and what type of break it should be. The break-after CSS property describes how the page, column or region break behaves after the generated box. If there is no generated box, the property is ignored. - */ - breakAfter?: any; - - /** - * Control page/column/region breaks that fall above a block of content - */ - breakBefore?: any; - - /** - * Control page/column/region breaks that fall within a block of content - */ - breakInside?: any; - - /** - * The clear CSS property specifies if an element can be positioned next to or must be positioned below the floating elements that precede it in the markup. - */ - clear?: any; - - /** - * Deprecated; see clip-path. - * Lets you specify the dimensions of an absolutely positioned element that should be visible, and the element is clipped into this shape, and displayed. - */ - clip?: any; - - /** - * Clipping crops an graphic, so that only a portion of the graphic is rendered, or filled. This clip-rule property, when used with the clip-path property, defines which clip rule, or algorithm, to use when filling the different parts of a graphics. - */ - clipRule?: any; - - /** - * The color property sets the color of an element's foreground content (usually text), accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a). - */ - color?: any; - - /** - * Describes the number of columns of the element. - */ - columnCount?: number; - - /** - * Specifies how to fill columns (balanced or sequential). - */ - columnFill?: any; - - /** - * The column-gap property controls the width of the gap between columns in multi-column elements. - */ - columnGap?: any; - - /** - * Sets the width, style, and color of the rule between columns. - */ - columnRule?: any; - - /** - * Specifies the color of the rule between columns. - */ - columnRuleColor?: any; - - /** - * Specifies the width of the rule between columns. - */ - columnRuleWidth?: any; - - /** - * The column-span CSS property makes it possible for an element to span across all columns when its value is set to all. An element that spans more than one column is called a spanning element. - */ - columnSpan?: any; - - /** - * Specifies the width of columns in multi-column elements. - */ - columnWidth?: any; - - /** - * This property is a shorthand property for setting column-width and/or column-count. - */ - columns?: any; - - /** - * The counter-increment property accepts one or more names of counters (identifiers), each one optionally followed by an integer which specifies the value by which the counter should be incremented (e.g. if the value is 2, the counter increases by 2 each time it is invoked). - */ - counterIncrement?: any; - - /** - * The counter-reset property contains a list of one or more names of counters, each one optionally followed by an integer (otherwise, the integer defaults to 0.) Each time the given element is invoked, the counters specified by the property are set to the given integer. - */ - counterReset?: any; - - /** - * The cue property specifies sound files (known as an "auditory icon") to be played by speech media agents before and after presenting an element's content; if only one file is specified, it is played both before and after. The volume at which the file(s) should be played, relative to the volume of the main element, may also be specified. The icon files may also be set separately with the cue-before and cue-after properties. - */ - cue?: any; - - /** - * The cue-after property specifies a sound file (known as an "auditory icon") to be played by speech media agents after presenting an element's content; the volume at which the file should be played may also be specified. The shorthand property cue sets cue sounds for both before and after the element is presented. - */ - cueAfter?: any; - - /** - * Specifies the mouse cursor displayed when the mouse pointer is over an element. - */ - cursor?: any; - - /** - * The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages. - */ - direction?: any; - - /** - * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. - */ - display?: any; - - /** - * The ‘fill’ property paints the interior of the given graphical element. The area to be painted consists of any areas inside the outline of the shape. To determine the inside of the shape, all subpaths are considered, and the interior is determined according to the rules associated with the current value of the ‘fill-rule’ property. The zero-width geometric outline of a shape is included in the area to be painted. - */ - fill?: any; - - /** - * SVG: Specifies the opacity of the color or the content the current object is filled with. - */ - fillOpacity?: number; - - /** - * The ‘fill-rule’ property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, the interpretation of "inside" is not so obvious. - * The ‘fill-rule’ property provides two options for how the inside of a shape is determined: - */ - fillRule?: any; - - /** - * Applies various image processing effects. This property is largely unsupported. See Compatibility section for more information. - */ - filter?: any; - - /** - * Shorthand for `flex-grow`, `flex-shrink`, and `flex-basis`. - */ - flex?: number | string; - - /** - * Obsolete, do not use. This property has been renamed to align-items. - * Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object. - */ - flexAlign?: any; - - /** - * The flex-basis CSS property describes the initial main size of the flex item before any free space is distributed according to the flex factors described in the flex property (flex-grow and flex-shrink). - */ - flexBasis?: any; - - /** - * The flex-direction CSS property describes how flex items are placed in the flex container, by setting the direction of the flex container's main axis. - */ - flexDirection?: any; - - /** - * The flex-flow CSS property defines the flex container's main and cross axis. It is a shorthand property for the flex-direction and flex-wrap properties. - */ - flexFlow?: any; - - /** - * Specifies the flex grow factor of a flex item. - */ - flexGrow?: number; - - /** - * Do not use. This property has been renamed to align-self - * Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object. - */ - flexItemAlign?: any; - - /** - * Do not use. This property has been renamed to align-content. - * Specifies how a flexbox's lines align within the flexbox when there is extra space along the axis that is perpendicular to the axis defined by the flex-direction property. - */ - flexLinePack?: any; - - /** - * Gets or sets a value that specifies the ordinal group that a flexbox element belongs to. This ordinal value identifies the display order for the group. - */ - flexOrder?: any; - - /** - * Specifies the flex shrink factor of a flex item. - */ - flexShrink?: number; - - /** - * Elements which have the style float are floated horizontally. These elements can move as far to the left or right of the containing element. All elements after the floating element will flow around it, but elements before the floating element are not impacted. If several floating elements are placed after each other, they will float next to each other as long as there is room. - */ - float?: any; - - /** - * Flows content from a named flow (specified by a corresponding flow-into) through selected elements to form a dynamic chain of layout regions. - */ - flowFrom?: any; - - /** - * The font property is shorthand that allows you to do one of two things: you can either set up six of the most mature font properties in one line, or you can set one of a choice of keywords to adopt a system font setting. - */ - font?: any; - - /** - * The font-family property allows one or more font family names and/or generic family names to be specified for usage on the selected element(s)' text. The browser then goes through the list; for each character in the selection it applies the first font family that has an available glyph for that character. - */ - fontFamily?: any; - - /** - * The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. This property controls metric kerning - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet. - */ - fontKerning?: any; - - /** - * Specifies the size of the font. Used to compute em and ex units. - */ - fontSize?: number | string; - - /** - * The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, so that the x-height is the same no matter what font is used. This preserves the readability of the text when fallback happens. - */ - fontSizeAdjust?: any; - - /** - * Allows you to expand or condense the widths for a normal, condensed, or expanded font face. - */ - fontStretch?: any; - - /** - * The font-style property allows normal, italic, or oblique faces to be selected. Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face. Oblique faces can be simulated by artificially sloping the glyphs of the regular face. - */ - fontStyle?: any; - - /** - * This value specifies whether the user agent is allowed to synthesize bold or oblique font faces when a font family lacks bold or italic faces. - */ - fontSynthesis?: any; - - /** - * The font-variant property enables you to select the small-caps font within a font family. - */ - fontVariant?: any; - - /** - * Fonts can provide alternate glyphs in addition to default glyph for a character. This property provides control over the selection of these alternate glyphs. - */ - fontVariantAlternates?: any; - - /** - * Specifies the weight or boldness of the font. - */ - fontWeight?: "normal" | "bold" | "lighter" | "bolder" | number; - - /** - * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration. - */ - gridArea?: any; - - /** - * Controls a grid item's placement in a grid area, particularly grid position and a grid span. Shorthand for setting grid-column-start and grid-column-end in a single declaration. - */ - gridColumn?: any; - - /** - * Controls a grid item's placement in a grid area as well as grid position and a grid span. The grid-column-end property (with grid-row-start, grid-row-end, and grid-column-start) determines a grid item's placement by specifying the grid lines of a grid item's grid area. - */ - gridColumnEnd?: any; - - /** - * Determines a grid item's placement by specifying the starting grid lines of a grid item's grid area . A grid item's placement in a grid area consists of a grid position and a grid span. See also ( grid-row-start, grid-row-end, and grid-column-end) - */ - gridColumnStart?: any; - - /** - * Gets or sets a value that indicates which row an element within a Grid should appear in. Shorthand for setting grid-row-start and grid-row-end in a single declaration. - */ - gridRow?: any; - - /** - * Determines a grid item’s placement by specifying the block-end. A grid item's placement in a grid area consists of a grid position and a grid span. The grid-row-end property (with grid-row-start, grid-column-start, and grid-column-end) determines a grid item's placement by specifying the grid lines of a grid item's grid area. - */ - gridRowEnd?: any; - - /** - * Specifies a row position based upon an integer location, string value, or desired row size. - * css/properties/grid-row is used as short-hand for grid-row-position and grid-row-position - */ - gridRowPosition?: any; - - gridRowSpan?: any; - - /** - * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand. - */ - gridTemplateAreas?: any; - - /** - * Specifies (with grid-template-rows) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. - */ - gridTemplateColumns?: any; - - /** - * Specifies (with grid-template-columns) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. - */ - gridTemplateRows?: any; - - /** - * Sets the height of an element. The content area of the element height does not include the padding, border, and margin of the element. - */ - height?: any; - - /** - * Specifies the minimum number of characters in a hyphenated word - */ - hyphenateLimitChars?: any; - - /** - * Indicates the maximum number of successive hyphenated lines in an element. The ‘no-limit’ value means that there is no limit. - */ - hyphenateLimitLines?: any; - - /** - * Specifies the maximum amount of trailing whitespace (before justification) that may be left in a line before hyphenation is triggered to pull part of a word from the next line back up into the current one. - */ - hyphenateLimitZone?: any; - - /** - * Specifies whether or not words in a sentence can be split by the use of a manual or automatic hyphenation mechanism. - */ - hyphens?: any; - - imeMode?: any; - - layoutGrid?: any; - - layoutGridChar?: any; - - layoutGridLine?: any; - - layoutGridMode?: any; - - layoutGridType?: any; - - /** - * Sets the left edge of an element - */ - left?: any; - - /** - * The letter-spacing CSS property specifies the spacing behavior between text characters. - */ - letterSpacing?: any; - - /** - * Deprecated. Gets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean. - */ - lineBreak?: any; - - lineClamp?: number; - - /** - * Specifies the height of an inline block level element. - */ - lineHeight?: number | string; - - /** - * Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration. - */ - listStyle?: any; - - /** - * This property sets the image that will be used as the list item marker. When the image is available, it will replace the marker set with the 'list-style-type' marker. That also means that if the image is not available, it will show the style specified by list-style-property - */ - listStyleImage?: any; - - /** - * Specifies if the list-item markers should appear inside or outside the content flow. - */ - listStylePosition?: any; - - /** - * Specifies the type of list-item marker in a list. - */ - listStyleType?: any; - - /** - * The margin property is shorthand to allow you to set all four margins of an element at once. Its equivalent longhand properties are margin-top, margin-right, margin-bottom and margin-left. Negative values are also allowed. - */ - margin?: any; - - /** - * margin-bottom sets the bottom margin of an element. - */ - marginBottom?: any; - - /** - * margin-left sets the left margin of an element. - */ - marginLeft?: any; - - /** - * margin-right sets the right margin of an element. - */ - marginRight?: any; - - /** - * margin-top sets the top margin of an element. - */ - marginTop?: any; - - /** - * The marquee-direction determines the initial direction in which the marquee content moves. - */ - marqueeDirection?: any; - - /** - * The 'marquee-style' property determines a marquee's scrolling behavior. - */ - marqueeStyle?: any; - - /** - * This property is shorthand for setting mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-composite and mask-size. Omitted values are set to their original properties' initial values. - */ - mask?: any; - - /** - * This property is shorthand for setting mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, and mask-border-repeat. Omitted values are set to their original properties' initial values. - */ - maskBorder?: any; - - /** - * This property specifies how the images for the sides and the middle part of the mask image are scaled and tiled. The first keyword applies to the horizontal sides, the second one applies to the vertical ones. If the second keyword is absent, it is assumed to be the same as the first, similar to the CSS border-image-repeat property. - */ - maskBorderRepeat?: any; - - /** - * This property specifies inward offsets from the top, right, bottom, and left edges of the mask image, dividing it into nine regions: four corners, four edges, and a middle. The middle image part is discarded and treated as fully transparent black unless the fill keyword is present. The four values set the top, right, bottom and left offsets in that order, similar to the CSS border-image-slice property. - */ - maskBorderSlice?: any; - - /** - * Specifies an image to be used as a mask. An image that is empty, fails to download, is non-existent, or cannot be displayed is ignored and does not mask the element. - */ - maskBorderSource?: any; - - /** - * This property sets the width of the mask box image, similar to the CSS border-image-width property. - */ - maskBorderWidth?: any; - - /** - * Determines the mask painting area, which defines the area that is affected by the mask. The painted content of an element may be restricted to this area. - */ - maskClip?: any; - - /** - * For elements rendered as a single box, specifies the mask positioning area. For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) specifies which boxes box-decoration-break operates on to determine the mask positioning area(s). - */ - maskOrigin?: any; - - /** - * This property must not be used. It is no longer included in any standard or standard track specification, nor is it implemented in any browser. It is only used when the text-align-last property is set to size. It controls allowed adjustments of font-size to fit line content. - */ - maxFontSize?: any; - - /** - * Sets the maximum height for an element. It prevents the height of the element to exceed the specified value. If min-height is specified and is greater than max-height, max-height is overridden. - */ - maxHeight?: any; - - /** - * Sets the maximum width for an element. It limits the width property to be larger than the value specified in max-width. - */ - maxWidth?: any; - - /** - * Sets the minimum height for an element. It prevents the height of the element to be smaller than the specified value. The value of min-height overrides both max-height and height. - */ - minHeight?: any; - - /** - * Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width. - */ - minWidth?: any; - - /** - * Specifies the transparency of an element. - */ - opacity?: number; - - /** - * Specifies the order used to lay out flex items in their flex container. - * Elements are laid out in the ascending order of the order value. - */ - order?: number; - - /** - * In paged media, this property defines the minimum number of lines in - * a block container that must be left at the bottom of the page. - */ - orphans?: number; - - /** - * The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient. - * Outlines differ from borders in the following ways: • Outlines do not take up space, they are drawn above the content. - * • Outlines may be non-rectangular. They are rectangular in Gecko/Firefox. Internet Explorer attempts to place the smallest contiguous outline around all elements or shapes that are indicated to have an outline. Opera draws a non-rectangular shape around a construct. - */ - outline?: any; - - /** - * The outline-color property sets the color of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out. - */ - outlineColor?: any; - - /** - * The outline-offset property offsets the outline and draw it beyond the border edge. - */ - outlineOffset?: any; - - /** - * The overflow property controls how extra content exceeding the bounding box of an element is rendered. It can be used in conjunction with an element that has a fixed width and height, to eliminate text-induced page distortion. - */ - overflow?: any; - - /** - * Specifies the preferred scrolling methods for elements that overflow. - */ - overflowStyle?: any; - - /** - * Controls how extra content exceeding the x-axis of the bounding box of an element is rendered. - */ - overflowX?: any; - - /** - * Controls how extra content exceeding the y-axis of the bounding box of an element is rendered. - */ - overflowY?: any; - - /** - * The padding optional CSS property sets the required padding space on one to four sides of an element. The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased. - * The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left). - */ - padding?: any; - - /** - * The padding-bottom CSS property of an element sets the padding space required on the bottom of an element. The padding area is the space between the content of the element and its border. Contrary to margin-bottom values, negative values of padding-bottom are invalid. - */ - paddingBottom?: any; - - /** - * The padding-left CSS property of an element sets the padding space required on the left side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-left values, negative values of padding-left are invalid. - */ - paddingLeft?: any; - - /** - * The padding-right CSS property of an element sets the padding space required on the right side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-right values, negative values of padding-right are invalid. - */ - paddingRight?: any; - - /** - * The padding-top CSS property of an element sets the padding space required on the top of an element. The padding area is the space between the content of the element and its border. Contrary to margin-top values, negative values of padding-top are invalid. - */ - paddingTop?: any; - - /** - * The page-break-after property is supported in all major browsers. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - pageBreakAfter?: any; - - /** - * The page-break-before property sets the page-breaking behavior before an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - pageBreakBefore?: any; - - /** - * Sets the page-breaking behavior inside an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - pageBreakInside?: any; - - /** - * The pause property determines how long a speech media agent should pause before and after presenting an element. It is a shorthand for the pause-before and pause-after properties. - */ - pause?: any; - - /** - * The pause-after property determines how long a speech media agent should pause after presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after. - */ - pauseAfter?: any; - - /** - * The pause-before property determines how long a speech media agent should pause before presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after. - */ - pauseBefore?: any; - - /** - * The perspective property defines how far an element is placed from the view on the z-axis, from the screen to the viewer. - * Perspective defines how an object is viewed. In graphic arts, perspective is the representation on a flat surface of what the viewer's eye would see in a 3D space. (See Wikipedia for more information about graphical perspective and for related illustrations.) - * The illusion of perspective on a flat surface, such as a computer screen, is created by projecting points on the flat surface as they would appear if the flat surface were a window through which the viewer was looking at the object. In discussion of virtual environments, this flat surface is called a projection plane. - */ - perspective?: any; - - /** - * The perspective-origin property establishes the origin for the perspective property. It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element. - * When used with perspective, perspective-origin changes the appearance of an object, as if a viewer were looking at it from a different origin. An object appears differently if a viewer is looking directly at it versus looking at it from below, above, or from the side. Thus, the perspective-origin is like a vanishing point. - * The default value of perspective-origin is 50% 50%. This displays an object as if the viewer's eye were positioned directly at the center of the screen, both top-to-bottom and left-to-right. A value of 0% 0% changes the object as if the viewer was looking toward the top left angle. A value of 100% 100% changes the appearance as if viewed toward the bottom right angle. - */ - perspectiveOrigin?: any; - - /** - * The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events. - */ - pointerEvents?: any; - - /** - * The position property controls the type of positioning used by an element within its parent elements. The effect of the position property depends on a lot of factors, for example the position property of parent elements. - */ - position?: any; - - /** - * Obsolete: unsupported. - * This property determines whether or not a full-width punctuation mark character should be trimmed if it appears at the beginning of a line, so that its "ink" lines up with the first glyph in the line above and below. - */ - punctuationTrim?: any; - - /** - * Sets the type of quotation marks for embedded quotations. - */ - quotes?: any; - - /** - * Controls whether the last region in a chain displays additional 'overset' content according its default overflow property, or if it displays a fragment of content as if it were flowing into a subsequent region. - */ - regionFragment?: any; - - /** - * The rest-after property determines how long a speech media agent should pause after presenting an element's main content, before presenting that element's exit cue sound. It may be replaced by the shorthand property rest, which sets rest time before and after. - */ - restAfter?: any; - - /** - * The rest-before property determines how long a speech media agent should pause after presenting an intro cue sound for an element, before presenting that element's main content. It may be replaced by the shorthand property rest, which sets rest time before and after. - */ - restBefore?: any; - - /** - * Specifies the position an element in relation to the right side of the containing element. - */ - right?: any; - - rubyAlign?: any; - - rubyPosition?: any; - - /** - * Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. - */ - shapeImageThreshold?: any; - - /** - * A future level of CSS Shapes will define a shape-inside property, which will define a shape to wrap content within the element. See Editor's Draft and CSSWG wiki page on next-level plans - */ - shapeInside?: any; - - /** - * Adds a margin to a shape-outside. In effect, defines a new shape that is the smallest contour around all the points that are the shape-margin distance outward perpendicular to each point on the underlying shape. For points where a perpendicular direction is not defined (e.g., a triangle corner), takes all points on a circle centered at the point and with a radius of the shape-margin distance. This property accepts only non-negative values. - */ - shapeMargin?: any; - - /** - * Declares a shape around which text should be wrapped, with possible modifications from the shape-margin property. The shape defined by shape-outside and shape-margin changes the geometry of a float element's float area. - */ - shapeOutside?: any; - - /** - * The speak property determines whether or not a speech synthesizer will read aloud the contents of an element. - */ - speak?: any; - - /** - * The speak-as property determines how the speech synthesizer interprets the content: words as whole words or as a sequence of letters, numbers as a numerical value or a sequence of digits, punctuation as pauses in speech or named punctuation characters. - */ - speakAs?: any; - - /** - * SVG: Specifies the opacity of the outline on the current object. - */ - strokeOpacity?: number; - - /** - * SVG: Specifies the width of the outline on the current object. - */ - strokeWidth?: number; - - /** - * The tab-size CSS property is used to customise the width of a tab (U+0009) character. - */ - tabSize?: any; - - /** - * The 'table-layout' property controls the algorithm used to lay out the table cells, rows, and columns. - */ - tableLayout?: any; - - /** - * The text-align CSS property describes how inline content like text is aligned in its parent block element. text-align does not control the alignment of block elements itself, only their inline content. - */ - textAlign?: any; - - /** - * The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element. - */ - textAlignLast?: any; - - /** - * The text-decoration CSS property is used to set the text formatting to underline, overline, line-through or blink. - * underline and overline decorations are positioned under the text, line-through over it. - */ - textDecoration?: any; - - /** - * Sets the color of any text decoration, such as underlines, overlines, and strike throughs. - */ - textDecorationColor?: any; - - /** - * Sets what kind of line decorations are added to an element, such as underlines, overlines, etc. - */ - textDecorationLine?: any; - - textDecorationLineThrough?: any; - - textDecorationNone?: any; - - textDecorationOverline?: any; - - /** - * Specifies what parts of an element’s content are skipped over when applying any text decoration. - */ - textDecorationSkip?: any; - - /** - * This property specifies the style of the text decoration line drawn on the specified element. The intended meaning for the values are the same as those of the border-style-properties. - */ - textDecorationStyle?: any; - - textDecorationUnderline?: any; - - /** - * The text-emphasis property will apply special emphasis marks to the elements text. Slightly similar to the text-decoration property only that this property can have affect on the line-height. It also is noted that this is shorthand for text-emphasis-style and for text-emphasis-color. - */ - textEmphasis?: any; - - /** - * The text-emphasis-color property specifies the foreground color of the emphasis marks. - */ - textEmphasisColor?: any; - - /** - * The text-emphasis-style property applies special emphasis marks to an element's text. - */ - textEmphasisStyle?: any; - - /** - * This property helps determine an inline box's block-progression dimension, derived from the text-height and font-size properties for non-replaced elements, the height or the width for replaced elements, and the stacked block-progression dimension for inline-block elements. The block-progression dimension determines the position of the padding, border and margin for the element. - */ - textHeight?: any; - - /** - * Specifies the amount of space horizontally that should be left on the first line of the text of an element. This horizontal spacing is at the beginning of the first line and is in respect to the left edge of the containing block box. - */ - textIndent?: any; - - textJustifyTrim?: any; - - textKashidaSpace?: any; - - /** - * The text-line-through property is a shorthand property for text-line-through-style, text-line-through-color and text-line-through-mode. (Considered obsolete; use text-decoration instead.) - */ - textLineThrough?: any; - - /** - * Specifies the line colors for the line-through text decoration. - * (Considered obsolete; use text-decoration-color instead.) - */ - textLineThroughColor?: any; - - /** - * Sets the mode for the line-through text decoration, determining whether the text decoration affects the space characters or not. - * (Considered obsolete; use text-decoration-skip instead.) - */ - textLineThroughMode?: any; - - /** - * Specifies the line style for line-through text decoration. - * (Considered obsolete; use text-decoration-style instead.) - */ - textLineThroughStyle?: any; - - /** - * Specifies the line width for the line-through text decoration. - */ - textLineThroughWidth?: any; - - /** - * The text-overflow shorthand CSS property determines how overflowed content that is not displayed is signaled to the users. It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. It covers the two long-hand properties text-overflow-mode and text-overflow-ellipsis - */ - textOverflow?: any; - - /** - * The text-overline property is the shorthand for the text-overline-style, text-overline-width, text-overline-color, and text-overline-mode properties. - */ - textOverline?: any; - - /** - * Specifies the line color for the overline text decoration. - */ - textOverlineColor?: any; - - /** - * Sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not. - */ - textOverlineMode?: any; - - /** - * Specifies the line style for overline text decoration. - */ - textOverlineStyle?: any; - - /** - * Specifies the line width for the overline text decoration. - */ - textOverlineWidth?: any; - - /** - * The text-rendering CSS property provides information to the browser about how to optimize when rendering text. Options are: legibility, speed or geometric precision. - */ - textRendering?: any; - - /** - * Obsolete: unsupported. - */ - textScript?: any; - - /** - * The CSS text-shadow property applies one or more drop shadows to the text and of an element. Each shadow is specified as an offset from the text, along with optional color and blur radius values. - */ - textShadow?: any; - - /** - * This property transforms text for styling purposes. (It has no effect on the underlying content.) - */ - textTransform?: any; - - /** - * Unsupported. - * This property will add a underline position value to the element that has an underline defined. - */ - textUnderlinePosition?: any; - - /** - * After review this should be replaced by text-decoration should it not? - * This property will set the underline style for text with a line value for underline, overline, and line-through. - */ - textUnderlineStyle?: any; - - /** - * This property specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the top edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). - */ - top?: any; - - /** - * Determines whether touch input may trigger default behavior supplied by the user agent, such as panning or zooming. - */ - touchAction?: any; - - /** - * CSS transforms allow elements styled with CSS to be transformed in two-dimensional or three-dimensional space. Using this property, elements can be translated, rotated, scaled, and skewed. The value list may consist of 2D and/or 3D transform values. - */ - transform?: any; - - /** - * This property defines the origin of the transformation axes relative to the element to which the transformation is applied. - */ - transformOrigin?: any; - - /** - * This property allows you to define the relative position of the origin of the transformation grid along the z-axis. - */ - transformOriginZ?: any; - - /** - * This property specifies how nested elements are rendered in 3D space relative to their parent. - */ - transformStyle?: any; - - /** - * The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, and transition-delay. It allows to define the transition between two states of an element. - */ - transition?: any; - - /** - * Defines when the transition will start. A value of ‘0s’ means the transition will execute as soon as the property is changed. Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset. - */ - transitionDelay?: any; - - /** - * The 'transition-duration' property specifies the length of time a transition animation takes to complete. - */ - transitionDuration?: any; - - /** - * The 'transition-property' property specifies the name of the CSS property to which the transition is applied. - */ - transitionProperty?: any; - - /** - * Sets the pace of action within a transition - */ - transitionTimingFunction?: any; - - /** - * The unicode-bidi CSS property specifies the level of embedding with respect to the bidirectional algorithm. - */ - unicodeBidi?: any; - - /** - * unicode-range allows you to set a specific range of characters to be downloaded from a font (embedded using @font-face) and made available for use on the current page. - */ - unicodeRange?: any; - - /** - * This is for all the high level UX stuff. - */ - userFocus?: any; - - /** - * For inputing user content - */ - userInput?: any; - - /** - * The vertical-align property controls how inline elements or text are vertically aligned compared to the baseline. If this property is used on table-cells it controls the vertical alignment of content of the table cell. - */ - verticalAlign?: any; - - /** - * The visibility property specifies whether the boxes generated by an element are rendered. - */ - visibility?: any; - - /** - * The voice-balance property sets the apparent position (in stereo sound) of the synthesized voice for spoken media. - */ - voiceBalance?: any; - - /** - * The voice-duration property allows the author to explicitly set the amount of time it should take a speech synthesizer to read an element's content, for example to allow the speech to be synchronized with other media. With a value of auto (the default) the length of time it takes to read the content is determined by the content itself and the voice-rate property. - */ - voiceDuration?: any; - - /** - * The voice-family property sets the speaker's voice used by a speech media agent to read an element. The speaker may be specified as a named character (to match a voice option in the speech reading software) or as a generic description of the age and gender of the voice. Similar to the font-family property for visual media, a comma-separated list of fallback options may be given in case the speech reader does not recognize the character name or cannot synthesize the requested combination of generic properties. - */ - voiceFamily?: any; - - /** - * The voice-pitch property sets pitch or tone (high or low) for the synthesized speech when reading an element; the pitch may be specified absolutely or relative to the normal pitch for the voice-family used to read the text. - */ - voicePitch?: any; - - /** - * The voice-range property determines how much variation in pitch or tone will be created by the speech synthesize when reading an element. Emphasized text, grammatical structures and punctuation may all be rendered as changes in pitch, this property determines how strong or obvious those changes are; large ranges are associated with enthusiastic or emotional speech, while small ranges are associated with flat or mechanical speech. - */ - voiceRange?: any; - - /** - * The voice-rate property sets the speed at which the voice synthesized by a speech media agent will read content. - */ - voiceRate?: any; - - /** - * The voice-stress property sets the level of vocal emphasis to be used for synthesized speech reading the element. - */ - voiceStress?: any; - - /** - * The voice-volume property sets the volume for spoken content in speech media. It replaces the deprecated volume property. - */ - voiceVolume?: any; - - /** - * The white-space property controls whether and how white space inside the element is collapsed, and whether lines may wrap at unforced "soft wrap" opportunities. - */ - whiteSpace?: any; - - /** - * Obsolete: unsupported. - */ - whiteSpaceTreatment?: any; - - /** - * In paged media, this property defines the mimimum number of lines - * that must be left at the top of the second page. - */ - widows?: number; - - /** - * Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element. - */ - width?: any; - - /** - * The word-break property is often used when there is long generated content that is strung together without and spaces or hyphens to beak apart. A common case of this is when there is a long URL that does not have any hyphens. This case could potentially cause the breaking of the layout as it could extend past the parent element. - */ - wordBreak?: any; - - /** - * The word-spacing CSS property specifies the spacing behavior between "words". - */ - wordSpacing?: any; - - /** - * An alias of css/properties/overflow-wrap, word-wrap defines whether to break words when the content exceeds the boundaries of its container. - */ - wordWrap?: any; - - /** - * Specifies how exclusions affect inline content within block-level elements. Elements lay out their inline content in their content area but wrap around exclusion areas. - */ - wrapFlow?: any; - - /** - * Set the value that is used to offset the inner wrap shape from other shapes. Inline content that intersects a shape with this property will be pushed by this shape's margin. - */ - wrapMargin?: any; - - /** - * Obsolete and unsupported. Do not use. - * This CSS property controls the text when it reaches the end of the block in which it is enclosed. - */ - wrapOption?: any; - - /** - * writing-mode specifies if lines of text are laid out horizontally or vertically, and the direction which lines of text and blocks progress. - */ - writingMode?: any; - - /** - * The z-index property specifies the z-order of an element and its descendants. - * When elements overlap, z-order determines which one covers the other. - */ - zIndex?: "auto" | number; - - /** - * Sets the initial zoom factor of a document defined by @viewport. - */ - zoom?: "auto" | number; - - [propertyName: string]: any; - } - - interface HTMLAttributes extends DOMAttributes { - // React-specific Attributes - defaultChecked?: boolean; - defaultValue?: string | string[]; - - // Standard HTML Attributes - accept?: string; - acceptCharset?: string; - accessKey?: string; - action?: string; - allowFullScreen?: boolean; - allowTransparency?: boolean; - alt?: string; - async?: boolean; - autoComplete?: string; - autoFocus?: boolean; - autoPlay?: boolean; - capture?: boolean; - cellPadding?: number | string; - cellSpacing?: number | string; - charSet?: string; - challenge?: string; - checked?: boolean; - classID?: string; - className?: string; - cols?: number; - colSpan?: number; - content?: string; - contentEditable?: boolean; - contextMenu?: string; - controls?: boolean; - coords?: string; - crossOrigin?: string; - data?: string; - dateTime?: string; - default?: boolean; - defer?: boolean; - dir?: string; - disabled?: boolean; - download?: any; - draggable?: boolean; - encType?: string; - form?: string; - formAction?: string; - formEncType?: string; - formMethod?: string; - formNoValidate?: boolean; - formTarget?: string; - frameBorder?: number | string; - headers?: string; - height?: number | string; - hidden?: boolean; - high?: number; - href?: string; - hrefLang?: string; - htmlFor?: string; - httpEquiv?: string; - icon?: string; - id?: string; - inputMode?: string; - integrity?: string; - is?: string; - keyParams?: string; - keyType?: string; - kind?: string; - label?: string; - lang?: string; - list?: string; - loop?: boolean; - low?: number; - manifest?: string; - marginHeight?: number; - marginWidth?: number; - max?: number | string; - maxLength?: number; - media?: string; - mediaGroup?: string; - method?: string; - min?: number | string; - minLength?: number; - multiple?: boolean; - muted?: boolean; - name?: string; - noValidate?: boolean; - open?: boolean; - optimum?: number; - pattern?: string; - placeholder?: string; - poster?: string; - preload?: string; - radioGroup?: string; - readOnly?: boolean; - rel?: string; - required?: boolean; - role?: string; - rows?: number; - rowSpan?: number; - sandbox?: string; - scope?: string; - scoped?: boolean; - scrolling?: string; - seamless?: boolean; - selected?: boolean; - shape?: string; - size?: number; - sizes?: string; - span?: number; - spellCheck?: boolean; - src?: string; - srcDoc?: string; - srcLang?: string; - srcSet?: string; - start?: number; - step?: number | string; - style?: CSSProperties; - summary?: string; - tabIndex?: number; - target?: string; - title?: string; - type?: string; - useMap?: string; - value?: string | string[]; - width?: number | string; - wmode?: string; - wrap?: string; - - // RDFa Attributes - about?: string; - datatype?: string; - inlist?: any; - prefix?: string; - property?: string; - resource?: string; - typeof?: string; - vocab?: string; - - // Non-standard Attributes - autoCapitalize?: string; - autoCorrect?: string; - autoSave?: string; - color?: string; - itemProp?: string; - itemScope?: boolean; - itemType?: string; - itemID?: string; - itemRef?: string; - results?: number; - security?: string; - unselectable?: boolean; - - // Allows aria- and data- Attributes - [key: string]: any; - } - - interface SVGAttributes extends HTMLAttributes { - clipPath?: string; - cx?: number | string; - cy?: number | string; - d?: string; - dx?: number | string; - dy?: number | string; - fill?: string; - fillOpacity?: number | string; - fontFamily?: string; - fontSize?: number | string; - fx?: number | string; - fy?: number | string; - gradientTransform?: string; - gradientUnits?: string; - markerEnd?: string; - markerMid?: string; - markerStart?: string; - offset?: number | string; - opacity?: number | string; - patternContentUnits?: string; - patternUnits?: string; - points?: string; - preserveAspectRatio?: string; - r?: number | string; - rx?: number | string; - ry?: number | string; - spreadMethod?: string; - stopColor?: string; - stopOpacity?: number | string; - stroke?: string; - strokeDasharray?: string; - strokeLinecap?: string; - strokeMiterlimit?: string; - strokeOpacity?: number | string; - strokeWidth?: number | string; - textAnchor?: string; - transform?: string; - version?: string; - viewBox?: string; - x1?: number | string; - x2?: number | string; - x?: number | string; - xlinkActuate?: string; - xlinkArcrole?: string; - xlinkHref?: string; - xlinkRole?: string; - xlinkShow?: string; - xlinkTitle?: string; - xlinkType?: string; - xmlBase?: string; - xmlLang?: string; - xmlSpace?: string; - y1?: number | string; - y2?: number | string; - y?: number | string; - } - - // - // React.DOM - // ---------------------------------------------------------------------- - - interface ReactDOM { - // HTML - a: HTMLFactory; - abbr: HTMLFactory; - address: HTMLFactory; - area: HTMLFactory; - article: HTMLFactory; - aside: HTMLFactory; - audio: HTMLFactory; - b: HTMLFactory; - base: HTMLFactory; - bdi: HTMLFactory; - bdo: HTMLFactory; - big: HTMLFactory; - blockquote: HTMLFactory; - body: HTMLFactory; - br: HTMLFactory; - button: HTMLFactory; - canvas: HTMLFactory; - caption: HTMLFactory; - cite: HTMLFactory; - code: HTMLFactory; - col: HTMLFactory; - colgroup: HTMLFactory; - data: HTMLFactory; - datalist: HTMLFactory; - dd: HTMLFactory; - del: HTMLFactory; - details: HTMLFactory; - dfn: HTMLFactory; - dialog: HTMLFactory; - div: HTMLFactory; - dl: HTMLFactory; - dt: HTMLFactory; - em: HTMLFactory; - embed: HTMLFactory; - fieldset: HTMLFactory; - figcaption: HTMLFactory; - figure: HTMLFactory; - footer: HTMLFactory; - form: HTMLFactory; - h1: HTMLFactory; - h2: HTMLFactory; - h3: HTMLFactory; - h4: HTMLFactory; - h5: HTMLFactory; - h6: HTMLFactory; - head: HTMLFactory; - header: HTMLFactory; - hgroup: HTMLFactory; - hr: HTMLFactory; - html: HTMLFactory; - i: HTMLFactory; - iframe: HTMLFactory; - img: HTMLFactory; - input: HTMLFactory; - ins: HTMLFactory; - kbd: HTMLFactory; - keygen: HTMLFactory; - label: HTMLFactory; - legend: HTMLFactory; - li: HTMLFactory; - link: HTMLFactory; - main: HTMLFactory; - map: HTMLFactory; - mark: HTMLFactory; - menu: HTMLFactory; - menuitem: HTMLFactory; - meta: HTMLFactory; - meter: HTMLFactory; - nav: HTMLFactory; - noscript: HTMLFactory; - object: HTMLFactory; - ol: HTMLFactory; - optgroup: HTMLFactory; - option: HTMLFactory; - output: HTMLFactory; - p: HTMLFactory; - param: HTMLFactory; - picture: HTMLFactory; - pre: HTMLFactory; - progress: HTMLFactory; - q: HTMLFactory; - rp: HTMLFactory; - rt: HTMLFactory; - ruby: HTMLFactory; - s: HTMLFactory; - samp: HTMLFactory; - script: HTMLFactory; - section: HTMLFactory; - select: HTMLFactory; - small: HTMLFactory; - source: HTMLFactory; - span: HTMLFactory; - strong: HTMLFactory; - style: HTMLFactory; - sub: HTMLFactory; - summary: HTMLFactory; - sup: HTMLFactory; - table: HTMLFactory; - tbody: HTMLFactory; - td: HTMLFactory; - textarea: HTMLFactory; - tfoot: HTMLFactory; - th: HTMLFactory; - thead: HTMLFactory; - time: HTMLFactory; - title: HTMLFactory; - tr: HTMLFactory; - track: HTMLFactory; - u: HTMLFactory; - ul: HTMLFactory; - "var": HTMLFactory; - video: HTMLFactory; - wbr: HTMLFactory; - - // SVG - svg: SVGFactory; - circle: SVGFactory; - defs: SVGFactory; - ellipse: SVGFactory; - g: SVGFactory; - image: SVGFactory; - line: SVGFactory; - linearGradient: SVGFactory; - mask: SVGFactory; - path: SVGFactory; - pattern: SVGFactory; - polygon: SVGFactory; - polyline: SVGFactory; - radialGradient: SVGFactory; - rect: SVGFactory; - stop: SVGFactory; - text: SVGFactory; - tspan: SVGFactory; - } - - // - // React.PropTypes - // ---------------------------------------------------------------------- - - interface Validator { - (object: T, key: string, componentName: string): Error; - } - - interface Requireable extends Validator { - isRequired: Validator; - } - - interface ValidationMap { - [key: string]: Validator; - } - - interface ReactPropTypes { - any: Requireable; - array: Requireable; - bool: Requireable; - func: Requireable; - number: Requireable; - object: Requireable; - string: Requireable; - node: Requireable; - element: Requireable; - instanceOf(expectedClass: {}): Requireable; - oneOf(types: any[]): Requireable; - oneOfType(types: Validator[]): Requireable; - arrayOf(type: Validator): Requireable; - objectOf(type: Validator): Requireable; - shape(type: ValidationMap): Requireable; - } - - // - // React.Children - // ---------------------------------------------------------------------- - - interface ReactChildren { - map(children: ReactNode, fn: (child: ReactChild, index: number) => T): T[]; - forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void; - count(children: ReactNode): number; - only(children: ReactNode): ReactElement; - toArray(children: ReactNode): ReactChild[]; - } - - // - // Browser Interfaces - // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts - // ---------------------------------------------------------------------- - - interface AbstractView { - styleMedia: StyleMedia; - document: Document; - } - - interface Touch { - identifier: number; - target: EventTarget; - screenX: number; - screenY: number; - clientX: number; - clientY: number; - pageX: number; - pageY: number; - } - - interface TouchList { - [index: number]: Touch; - length: number; - item(index: number): Touch; - identifiedTouch(identifier: number): Touch; - } -} - -declare module "react" { - export = __React; -} - -declare namespace JSX { - import React = __React; - - interface Element extends React.ReactElement { } - interface ElementClass extends React.Component { - render(): JSX.Element; - } - interface ElementAttributesProperty { props: {}; } - - interface IntrinsicAttributes { - key?: React.Key; - } - - interface IntrinsicClassAttributes { - ref?: React.Ref; - } - - interface IntrinsicElements { - // HTML - a: React.HTMLProps; - abbr: React.HTMLProps; - address: React.HTMLProps; - area: React.HTMLProps; - article: React.HTMLProps; - aside: React.HTMLProps; - audio: React.HTMLProps; - b: React.HTMLProps; - base: React.HTMLProps; - bdi: React.HTMLProps; - bdo: React.HTMLProps; - big: React.HTMLProps; - blockquote: React.HTMLProps; - body: React.HTMLProps; - br: React.HTMLProps; - button: React.HTMLProps; - canvas: React.HTMLProps; - caption: React.HTMLProps; - cite: React.HTMLProps; - code: React.HTMLProps; - col: React.HTMLProps; - colgroup: React.HTMLProps; - data: React.HTMLProps; - datalist: React.HTMLProps; - dd: React.HTMLProps; - del: React.HTMLProps; - details: React.HTMLProps; - dfn: React.HTMLProps; - dialog: React.HTMLProps; - div: React.HTMLProps; - dl: React.HTMLProps; - dt: React.HTMLProps; - em: React.HTMLProps; - embed: React.HTMLProps; - fieldset: React.HTMLProps; - figcaption: React.HTMLProps; - figure: React.HTMLProps; - footer: React.HTMLProps; - form: React.HTMLProps; - h1: React.HTMLProps; - h2: React.HTMLProps; - h3: React.HTMLProps; - h4: React.HTMLProps; - h5: React.HTMLProps; - h6: React.HTMLProps; - head: React.HTMLProps; - header: React.HTMLProps; - hgroup: React.HTMLProps; - hr: React.HTMLProps; - html: React.HTMLProps; - i: React.HTMLProps; - iframe: React.HTMLProps; - img: React.HTMLProps; - input: React.HTMLProps; - ins: React.HTMLProps; - kbd: React.HTMLProps; - keygen: React.HTMLProps; - label: React.HTMLProps; - legend: React.HTMLProps; - li: React.HTMLProps; - link: React.HTMLProps; - main: React.HTMLProps; - map: React.HTMLProps; - mark: React.HTMLProps; - menu: React.HTMLProps; - menuitem: React.HTMLProps; - meta: React.HTMLProps; - meter: React.HTMLProps; - nav: React.HTMLProps; - noscript: React.HTMLProps; - object: React.HTMLProps; - ol: React.HTMLProps; - optgroup: React.HTMLProps; - option: React.HTMLProps; - output: React.HTMLProps; - p: React.HTMLProps; - param: React.HTMLProps; - picture: React.HTMLProps; - pre: React.HTMLProps; - progress: React.HTMLProps; - q: React.HTMLProps; - rp: React.HTMLProps; - rt: React.HTMLProps; - ruby: React.HTMLProps; - s: React.HTMLProps; - samp: React.HTMLProps; - script: React.HTMLProps; - section: React.HTMLProps; - select: React.HTMLProps; - small: React.HTMLProps; - source: React.HTMLProps; - span: React.HTMLProps; - strong: React.HTMLProps; - style: React.HTMLProps; - sub: React.HTMLProps; - summary: React.HTMLProps; - sup: React.HTMLProps; - table: React.HTMLProps; - tbody: React.HTMLProps; - td: React.HTMLProps; - textarea: React.HTMLProps; - tfoot: React.HTMLProps; - th: React.HTMLProps; - thead: React.HTMLProps; - time: React.HTMLProps; - title: React.HTMLProps; - tr: React.HTMLProps; - track: React.HTMLProps; - u: React.HTMLProps; - ul: React.HTMLProps; - "var": React.HTMLProps; - video: React.HTMLProps; - wbr: React.HTMLProps; - - // SVG - svg: React.SVGProps; - - circle: React.SVGProps; - clipPath: React.SVGProps; - defs: React.SVGProps; - ellipse: React.SVGProps; - g: React.SVGProps; - image: React.SVGProps; - line: React.SVGProps; - linearGradient: React.SVGProps; - mask: React.SVGProps; - path: React.SVGProps; - pattern: React.SVGProps; - polygon: React.SVGProps; - polyline: React.SVGProps; - radialGradient: React.SVGProps; - rect: React.SVGProps; - stop: React.SVGProps; - text: React.SVGProps; - tspan: React.SVGProps; - } -} diff --git a/templates/ReactReduxSpa/typings/redux-thunk/redux-thunk.d.ts b/templates/ReactReduxSpa/typings/redux-thunk/redux-thunk.d.ts deleted file mode 100644 index aafaa045..00000000 --- a/templates/ReactReduxSpa/typings/redux-thunk/redux-thunk.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -// Type definitions for redux-thunk -// Project: https://github.com/gaearon/redux-thunk -// Definitions by: Qubo -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module ReduxThunk { - export interface Thunk extends Redux.Middleware {} - export interface ThunkInterface { - (dispatch: Redux.Dispatch, getState?: () => T): any; - } -} - -declare module "redux-thunk" { - var thunk: ReduxThunk.Thunk; - export = thunk; -} diff --git a/templates/ReactReduxSpa/typings/redux/redux.d.ts b/templates/ReactReduxSpa/typings/redux/redux.d.ts deleted file mode 100644 index 44cb297c..00000000 --- a/templates/ReactReduxSpa/typings/redux/redux.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -// Type definitions for Redux v1.0.0 -// Project: https://github.com/rackt/redux -// Definitions by: William Buchwalter , Vincent Prouillet -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare module Redux { - - interface ActionCreator extends Function { - (...args: any[]): any; - } - - interface Reducer extends Function { - (state: any, action: any): any; - } - - interface Dispatch extends Function { - (action: any): any; - } - - interface StoreMethods { - dispatch: Dispatch; - getState(): any; - } - - - interface MiddlewareArg { - dispatch: Dispatch; - getState: Function; - } - - interface Middleware extends Function { - (obj: MiddlewareArg): Function; - } - - class Store { - getReducer(): Reducer; - replaceReducer(nextReducer: Reducer): void; - dispatch(action: any): any; - getState(): any; - subscribe(listener: Function): Function; - } - - function createStore(reducer: Reducer, initialState?: any, enhancer?: ()=>any): Store; - function bindActionCreators(actionCreators: T, dispatch: Dispatch): T; - function combineReducers(reducers: any): Reducer; - function applyMiddleware(...middlewares: Middleware[]): Function; - function compose(...functions: Function[]): T; -} - -declare module "redux" { - export = Redux; -} diff --git a/templates/ReactReduxSpa/typings/source-map/source-map.d.ts b/templates/ReactReduxSpa/typings/source-map/source-map.d.ts deleted file mode 100644 index 34aae2b6..00000000 --- a/templates/ReactReduxSpa/typings/source-map/source-map.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -// Type definitions for source-map v0.1.38 -// Project: https://github.com/mozilla/source-map -// Definitions by: Morten Houston Ludvigsen -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare module SourceMap { - interface StartOfSourceMap { - file?: string; - sourceRoot?: string; - } - - interface RawSourceMap extends StartOfSourceMap { - version: string; - sources: Array; - names: Array; - sourcesContent?: string[]; - mappings: string; - } - - interface Position { - line: number; - column: number; - } - - interface MappedPosition extends Position { - source: string; - name?: string; - } - - interface MappingItem { - source: string; - generatedLine: number; - generatedColumn: number; - originalLine: number; - originalColumn: number; - name: string; - } - - interface Mapping { - generated: Position; - original: Position; - source: string; - name?: string; - } - - interface CodeWithSourceMap { - code: string; - map: SourceMapGenerator; - } - - class SourceMapConsumer { - public static GENERATED_ORDER: number; - public static ORIGINAL_ORDER: number; - - constructor(rawSourceMap: RawSourceMap); - public originalPositionFor(generatedPosition: Position): MappedPosition; - public generatedPositionFor(originalPosition: MappedPosition): Position; - public sourceContentFor(source: string): string; - public eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; - } - - class SourceMapGenerator { - constructor(startOfSourceMap?: StartOfSourceMap); - public static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator; - public addMapping(mapping: Mapping): void; - public setSourceContent(sourceFile: string, sourceContent: string): void; - public applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; - public toString(): string; - } - - class SourceNode { - constructor(); - constructor(line: number, column: number, source: string); - constructor(line: number, column: number, source: string, chunk?: string, name?: string); - public static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode; - public add(chunk: any): SourceNode; - public prepend(chunk: any): SourceNode; - public setSourceContent(sourceFile: string, sourceContent: string): void; - public walk(fn: (chunk: string, mapping: MappedPosition) => void): void; - public walkSourceContents(fn: (file: string, content: string) => void): void; - public join(sep: string): SourceNode; - public replaceRight(pattern: string, replacement: string): SourceNode; - public toString(): string; - public toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap; - } -} - -declare module 'source-map' { - export = SourceMap; -} diff --git a/templates/ReactReduxSpa/typings/tsd.d.ts b/templates/ReactReduxSpa/typings/tsd.d.ts deleted file mode 100644 index 4a4bd182..00000000 --- a/templates/ReactReduxSpa/typings/tsd.d.ts +++ /dev/null @@ -1,13 +0,0 @@ - -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// diff --git a/templates/ReactReduxSpa/typings/uglify-js/uglify-js.d.ts b/templates/ReactReduxSpa/typings/uglify-js/uglify-js.d.ts deleted file mode 100644 index b9c22bc6..00000000 --- a/templates/ReactReduxSpa/typings/uglify-js/uglify-js.d.ts +++ /dev/null @@ -1,430 +0,0 @@ -// Type definitions for UglifyJS 2 v2.6.1 -// Project: https://github.com/mishoo/UglifyJS2 -// Definitions by: Tanguy Krotoff -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module 'uglify-js' { - import * as MOZ_SourceMap from 'source-map'; - - namespace UglifyJS { - interface Tokenizer { - /** - * The type of this token. - * Can be "num", "string", "regexp", "operator", "punc", "atom", "name", "keyword", "comment1" or "comment2". - * "comment1" and "comment2" are for single-line, respectively multi-line comments. - */ - type: string; - - /** - * The name of the file where this token originated from. Useful when compressing multiple files at once to generate the proper source map. - */ - file: string; - - /** - * The "value" of the token. - * That's additional information and depends on the token type: "num", "string" and "regexp" tokens you get their literal value. - * - For "operator" you get the operator. - * - For "punc" it's the punctuation sign (parens, comma, semicolon etc). - * - For "atom", "name" and "keyword" it's the name of the identifier - * - For comments it's the body of the comment (excluding the initial "//" and "/*". - */ - value: string; - - /** - * The line number of this token in the original code. - * 1-based index. - */ - line: number; - - /** - * The column number of this token in the original code. - * 0-based index. - */ - col: number; - - /** - * Short for "newline before", it's a boolean that tells us whether there was a newline before this node in the original source. It helps for automatic semicolon insertion. - * For multi-line comments in particular this will be set to true if there either was a newline before this comment, or * * if this comment contains a newline. - */ - nlb: boolean; - - /** - * This doesn't apply for comment tokens, but for all other token types it will be an array of comment tokens that were found before. - */ - comments_before: string[]; - } - - interface AST_Node { - // The first token of this node - start: AST_Node; - - // The last token of this node - end: AST_Node; - - transform(tt: TreeTransformer): AST_Toplevel; - } - - interface AST_Toplevel extends AST_Node { - // UglifyJS contains a scope analyzer which figures out variable/function definitions, references etc. - // You need to call it manually before compression or mangling. - // The figure_out_scope method is defined only on the AST_Toplevel node. - figure_out_scope(): void; - - // Get names that are optimized for GZip compression (names will be generated using the most frequent characters first) - compute_char_frequency(): void; - - mangle_names(): void; - - print(stream: OutputStream): void; - - print_to_string(options?: BeautifierOptions): string; - } - - interface MinifyOptions { - spidermonkey?: boolean; - outSourceMap?: string; - sourceRoot?: string; - inSourceMap?: string; - fromString?: boolean; - warnings?: boolean; - mangle?: Object; - output?: MinifyOutput, - compress?: Object; - } - - interface MinifyOutput { - code: string; - map: string; - } - - function minify(files: string | Array, options?: MinifyOptions): MinifyOutput; - - - interface ParseOptions { - // Default is false - strict?: boolean; - - // Input file name, default is null - filename?: string; - - // Default is null - toplevel?: AST_Toplevel; - } - - /** - * The parser creates a custom abstract syntax tree given a piece of JavaScript code. - * Perhaps you should read about the AST first. - */ - function parse(code: string, options?: ParseOptions): AST_Toplevel; - - - interface BeautifierOptions { - /** - * Start indentation on every line (only when `beautify`) - */ - indent_start?: number; - - /** - * Indentation level (only when `beautify`) - */ - indent_level?: number; - - /** - * Quote all keys in object literals? - */ - quote_keys?: boolean; - - /** - * Add a space after colon signs? - */ - space_colon?: boolean; - - /** - * Output ASCII-safe? (encodes Unicode characters as ASCII) - */ - ascii_only?: boolean; - - /** - * Escape " boolean; - - /** - * UglifyJS provides a TreeWalker object and every node has a walk method that given a walker will apply your visitor to each node in the tree. - * Your visitor can return a non-falsy value in order to prevent descending the current node. - */ - function TreeWalker(visitor: visitor): TreeWalker; - - - // TODO - interface TreeTransformer extends TreeWalker { - } - - /** - * The tree transformer is a special case of a tree walker. - * In fact it even inherits from TreeWalker and you can use the same methods, but initialization and visitor protocol are a bit different. - */ - function TreeTransformer(before: visitor, after: visitor): TreeTransformer; - } - - export = UglifyJS; -} diff --git a/templates/ReactReduxSpa/typings/webpack/webpack-env.d.ts b/templates/ReactReduxSpa/typings/webpack/webpack-env.d.ts deleted file mode 100644 index 04580949..00000000 --- a/templates/ReactReduxSpa/typings/webpack/webpack-env.d.ts +++ /dev/null @@ -1,232 +0,0 @@ -// Type definitions for webpack 1.12.2 (module API) -// Project: https://github.com/webpack/webpack -// Definitions by: use-strict -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/** - * Webpack module API - variables and global functions available inside modules - */ - -declare namespace __WebpackModuleApi { - interface RequireContext { - keys(): string[]; - (id: string): T; - resolve(id: string): string; - } - - interface RequireFunction { - /** - * Returns the exports from a dependency. The call is sync. No request to the server is fired. The compiler ensures that the dependency is available. - */ - (path: string): T; - /** - * Behaves similar to require.ensure, but the callback is called with the exports of each dependency in the paths array. There is no option to provide a chunk name. - */ - (paths: string[], callback: (...modules: any[]) => void): void; - /** - * Download additional dependencies on demand. The paths array lists modules that should be available. When they are, callback is called. If the callback is a function expression, dependencies in that source part are extracted and also loaded on demand. A single request is fired to the server, except if all modules are already available. - * - * This creates a chunk. The chunk can be named. If a chunk with this name already exists, the dependencies are merged into that chunk and that chunk is used. - */ - ensure: (paths: string[], callback: (require: (path: string) => T) => void, chunkName?: string) => void; - context: (path: string, deep?: boolean, filter?: RegExp) => RequireContext; - /** - * Returns the module id of a dependency. The call is sync. No request to the server is fired. The compiler ensures that the dependency is available. - * - * The module id is a number in webpack (in contrast to node.js where it is a string, the filename). - */ - resolve(path: string): number; - /** - * Like require.resolve, but doesn’t include the module into the bundle. It’s a weak dependency. - */ - resolveWeak(path: string): number; - /** - * Ensures that the dependency is available, but don’t execute it. This can be use for optimizing the position of a module in the chunks. - */ - include(path: string): void; - /** - * Multiple requires to the same module result in only one module execution and only one export. Therefore a cache in the runtime exists. Removing values from this cache cause new module execution and a new export. This is only needed in rare cases (for compatibility!). - */ - cache: { - [id: string]: any; - } - } - - interface Module { - exports: any; - require(id: string): any; - id: string; - filename: string; - loaded: boolean; - parent: any; - children: any[]; - hot: Hot; - } - type ModuleId = string|number; - - interface Hot { - /** - * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced. - * @param dependencies - * @param callback - */ - accept(dependencies: string[], callback: (updatedDependencies: ModuleId[]) => void): void; - /** - * Accept code updates for the specified dependencies. The callback is called when dependencies were replaced. - * @param dependency - * @param callback - */ - accept(dependency: string, callback: () => void): void; - /** - * Accept code updates for this module without notification of parents. - * This should only be used if the module doesn’t export anything. - * The errHandler can be used to handle errors that occur while loading the updated module. - * @param errHandler - */ - accept(errHandler?: (err: Error) => void): void; - /** - * Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline". - */ - decline(dependencies: string[]): void; - /** - * Do not accept updates for the specified dependencies. If any dependencies is updated, the code update fails with code "decline". - */ - decline(dependency: string): void; - /** - * Flag the current module as not update-able. If updated the update code would fail with code "decline". - */ - decline(): void; - /** - * Add a one time handler, which is executed when the current module code is replaced. - * Here you should destroy/remove any persistent resource you have claimed/created. - * If you want to transfer state to the new module, add it to data object. - * The data will be available at module.hot.data on the new module. - * @param callback - */ - dispose(callback: (data: T) => void): void; - /** - * Add a one time handler, which is executed when the current module code is replaced. - * Here you should destroy/remove any persistent resource you have claimed/created. - * If you want to transfer state to the new module, add it to data object. - * The data will be available at module.hot.data on the new module. - * @param callback - */ - addDisposeHandler(callback: (data: T) => void): void; - /** - * Remove a handler. - * This can useful to add a temporary dispose handler. You could i. e. replace code while in the middle of a multi-step async function. - * @param callback - */ - removeDisposeHandler(callback: (data: T) => void): void; - /** - * Throws an exceptions if status() is not idle. - * Check all currently loaded modules for updates and apply updates if found. - * If no update was found, the callback is called with null. - * If autoApply is truthy the callback will be called with all modules that were disposed. - * apply() is automatically called with autoApply as options parameter. - * If autoApply is not set the callback will be called with all modules that will be disposed on apply(). - * @param autoApply - * @param callback - */ - check(autoApply: boolean, callback: (err: Error, outdatedModules: ModuleId[]) => void): void; - /** - * Throws an exceptions if status() is not idle. - * Check all currently loaded modules for updates and apply updates if found. - * If no update was found, the callback is called with null. - * The callback will be called with all modules that will be disposed on apply(). - * @param callback - */ - check(callback: (err: Error, outdatedModules: ModuleId[]) => void): void; - /** - * If status() != "ready" it throws an error. - * Continue the update process. - * @param options - * @param callback - */ - apply(options: AcceptOptions, callback: (err: Error, outdatedModules: ModuleId[]) => void): void; - /** - * If status() != "ready" it throws an error. - * Continue the update process. - * @param callback - */ - apply(callback: (err: Error, outdatedModules: ModuleId[]) => void): void; - /** - * Return one of idle, check, watch, watch-delay, prepare, ready, dispose, apply, abort or fail. - */ - status(): string; - /** Register a callback on status change. */ - status(callback: (status: string) => void): void; - /** Register a callback on status change. */ - addStatusHandler(callback: (status: string) => void): void; - /** - * Remove a registered status change handler. - * @param callback - */ - removeStatusHandler(callback: (status: string) => void): void; - - active: boolean; - data: {}; - } - - interface AcceptOptions { - /** - * If true the update process continues even if some modules are not accepted (and would bubble to the entry point). - */ - ignoreUnaccepted?: boolean; - /** - * Indicates that apply() is automatically called by check function - */ - autoApply?: boolean; - } -} - -declare var require: __WebpackModuleApi.RequireFunction; - -/** - * The resource query of the current module. - * - * e.g. __resourceQuery === "?test" // Inside "file.js?test" - */ -declare var __resourceQuery: string; - -/** - * Equals the config options output.publicPath. - */ -declare var __webpack_public_path__: string; - -/** - * The raw require function. This expression isn’t parsed by the Parser for dependencies. - */ -declare var __webpack_require__: any; - -/** - * The internal chunk loading function - * - * @param chunkId The id for the chunk to load. - * @param callback A callback function called once the chunk is loaded. - */ -declare var __webpack_chunk_load__: (chunkId: any, callback: (require: (id: string) => any) => void) => void; - -/** - * Access to the internal object of all modules. - */ -declare var __webpack_modules__: any[]; - -/** - * Access to the hash of the compilation. - * - * Only available with the HotModuleReplacementPlugin or the ExtendedAPIPlugin - */ -declare var __webpack_hash__: any; - -/** - * Generates a require function that is not parsed by webpack. Can be used to do cool stuff with a global require function if available. - */ -declare var __non_webpack_require__: any; - -/** - * Equals the config option debug - */ -declare var DEBUG: boolean; - -declare var module: __WebpackModuleApi.Module; diff --git a/templates/ReactReduxSpa/typings/whatwg-fetch/whatwg-fetch.d.ts b/templates/ReactReduxSpa/typings/whatwg-fetch/whatwg-fetch.d.ts deleted file mode 100644 index 64dd9048..00000000 --- a/templates/ReactReduxSpa/typings/whatwg-fetch/whatwg-fetch.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -// Type definitions for fetch API -// Project: https://github.com/github/fetch -// Definitions by: Ryan Graham -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare class Request extends Body { - constructor(input: string|Request, init?:RequestInit); - method: string; - url: string; - headers: Headers; - context: string|RequestContext; - referrer: string; - mode: string|RequestMode; - credentials: string|RequestCredentials; - cache: string|RequestCache; -} - -interface RequestInit { - method?: string; - headers?: HeaderInit|{ [index: string]: string }; - body?: BodyInit; - mode?: string|RequestMode; - credentials?: string|RequestCredentials; - cache?: string|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; - json(): Promise; - text(): Promise; -} -declare class Response extends Body { - constructor(body?: BodyInit, init?: ResponseInit); - error(): Response; - redirect(url: string, status: number): Response; - type: string|ResponseType; - url: string; - status: number; - ok: boolean; - statusText: string; - headers: Headers; - clone(): Response; -} - -declare enum ResponseType { "basic", "cors", "default", "error", "opaque" } - -interface 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|Request, init?: RequestInit): Promise; -} - -declare var fetch: typeof window.fetch; diff --git a/templates/ReactReduxSpa/web.config b/templates/ReactReduxSpa/web.config deleted file mode 100644 index a8d66727..00000000 --- a/templates/ReactReduxSpa/web.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/templates/ReactReduxSpa/webpack.config.dev.js b/templates/ReactReduxSpa/webpack.config.dev.js deleted file mode 100644 index 719de1fb..00000000 --- a/templates/ReactReduxSpa/webpack.config.dev.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - devtool: 'inline-source-map' -}; diff --git a/templates/ReactReduxSpa/webpack.config.js b/templates/ReactReduxSpa/webpack.config.js deleted file mode 100644 index b3657570..00000000 --- a/templates/ReactReduxSpa/webpack.config.js +++ /dev/null @@ -1,36 +0,0 @@ -var path = require('path'); -var webpack = require('webpack'); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); -var merge = require('extendify')({ isDeep: true, arrays: 'concat' }); -var devConfig = require('./webpack.config.dev'); -var prodConfig = require('./webpack.config.prod'); -var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; -var extractCSS = new ExtractTextPlugin('site.css'); - -module.exports = merge({ - resolve: { - extensions: [ '', '.js', '.jsx', '.ts', '.tsx' ] - }, - module: { - loaders: [ - { test: /\.ts(x?)$/, include: /ClientApp/, loader: 'babel-loader' }, - { test: /\.ts(x?)$/, include: /ClientApp/, loader: 'ts-loader' }, - { test: /\.css/, loader: extractCSS.extract(['css']) } - ] - }, - entry: { - main: ['./ClientApp/boot-client.tsx'], - }, - output: { - path: path.join(__dirname, 'wwwroot', 'dist'), - filename: '[name].js', - publicPath: '/dist/' - }, - plugins: [ - extractCSS, - new webpack.DllReferencePlugin({ - context: __dirname, - manifest: require('./wwwroot/dist/vendor-manifest.json') - }) - ] -}, isDevelopment ? devConfig : prodConfig); diff --git a/templates/ReactReduxSpa/webpack.config.prod.js b/templates/ReactReduxSpa/webpack.config.prod.js deleted file mode 100644 index 0731f000..00000000 --- a/templates/ReactReduxSpa/webpack.config.prod.js +++ /dev/null @@ -1,9 +0,0 @@ -var webpack = require('webpack'); - -module.exports = { - plugins: [ - new webpack.optimize.OccurenceOrderPlugin(), - new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }), - new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"' }) - ] -}; diff --git a/templates/ReactReduxSpa/webpack.config.vendor.js b/templates/ReactReduxSpa/webpack.config.vendor.js deleted file mode 100644 index 8e04124c..00000000 --- a/templates/ReactReduxSpa/webpack.config.vendor.js +++ /dev/null @@ -1,37 +0,0 @@ -var path = require('path'); -var webpack = require('webpack'); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); -var extractCSS = new ExtractTextPlugin('vendor.css'); -var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; - -module.exports = { - resolve: { - extensions: [ '', '.js' ] - }, - module: { - loaders: [ - { test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }, - { test: /\.css/, loader: extractCSS.extract(['css']) } - ] - }, - entry: { - vendor: ['bootstrap', 'bootstrap/dist/css/bootstrap.css', 'react', 'react-dom', 'react-router', 'style-loader', 'jquery'], - }, - output: { - path: path.join(__dirname, 'wwwroot', 'dist'), - filename: '[name].js', - library: '[name]_[hash]', - }, - plugins: [ - extractCSS, - new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable) - new webpack.optimize.OccurenceOrderPlugin(), - new webpack.DllPlugin({ - path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'), - name: '[name]_[hash]' - }) - ].concat(isDevelopment ? [] : [ - new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }), - new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"' }) - ]) -}; diff --git a/templates/ReactReduxSpa/wwwroot/favicon.ico b/templates/ReactReduxSpa/wwwroot/favicon.ico deleted file mode 100755 index a3a79998..00000000 Binary files a/templates/ReactReduxSpa/wwwroot/favicon.ico and /dev/null differ diff --git a/templates/ReactReduxSpa/wwwroot/web.config b/templates/ReactReduxSpa/wwwroot/web.config deleted file mode 100644 index e70a7778..00000000 --- a/templates/ReactReduxSpa/wwwroot/web.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/templates/ReactSpa/.babelrc b/templates/ReactSpa/.babelrc deleted file mode 100644 index 86c445f5..00000000 --- a/templates/ReactSpa/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["es2015", "react"] -} diff --git a/templates/ReactSpa/ClientApp/boot.tsx b/templates/ReactSpa/ClientApp/boot.tsx deleted file mode 100644 index 919c22ef..00000000 --- a/templates/ReactSpa/ClientApp/boot.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import 'bootstrap'; -import 'bootstrap/dist/css/bootstrap.css'; -import './css/site.css'; - -import * as React from 'react'; -import * as ReactDOM from 'react-dom'; -import { browserHistory, Router } from 'react-router'; -import routes from './routes'; - -// This code starts up the React app when it runs in a browser. It sets up the routing configuration -// and injects the app into a DOM element. -ReactDOM.render( - , - document.getElementById('react-app') -); diff --git a/templates/ReactSpa/ClientApp/components/Counter.tsx b/templates/ReactSpa/ClientApp/components/Counter.tsx deleted file mode 100644 index 233bed06..00000000 --- a/templates/ReactSpa/ClientApp/components/Counter.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import * as React from 'react'; - -interface CounterState { - currentCount: number; -} - -export class Counter extends React.Component { - constructor() { - super(); - this.state = { currentCount: 0 }; - } - - public render() { - return

    ; - } - - incrementCounter() { - this.setState({ - currentCount: this.state.currentCount + 1 - }); - } -} diff --git a/templates/ReactSpa/ClientApp/components/FetchData.tsx b/templates/ReactSpa/ClientApp/components/FetchData.tsx deleted file mode 100644 index a010bac0..00000000 --- a/templates/ReactSpa/ClientApp/components/FetchData.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import * as React from 'react'; - -interface FetchDataExampleState { - forecasts: WeatherForecast[]; - loading: boolean; -} - -export class FetchData extends React.Component { - constructor() { - super(); - this.state = { forecasts: [], loading: true }; - - fetch('http://github.com/api/SampleData/WeatherForecasts') - .then(response => response.json()) - .then((data: WeatherForecast[]) => { - this.setState({ forecasts: data, loading: false }); - }); - } - - public render() { - let contents = this.state.loading - ?

    Loading...

    - : FetchData.renderForecastsTable(this.state.forecasts); - - return
    -

    Weather forecast

    -

    This component demonstrates fetching data from the server.

    - { contents } -

    For more sophisticated applications, consider an architecture such as Redux or Flux for managing state. You can generate an ASP.NET Core application with React and Redux using dotnet new aspnet/spa/reactredux instead of using this template.

    -
    ; - } - - private static renderForecastsTable(forecasts: WeatherForecast[]) { - return - - - - - - - - - - {forecasts.map(forecast => - - - - - - - )} - -
    DateTemp. (C)Temp. (F)Summary
    { forecast.dateFormatted }{ forecast.temperatureC }{ forecast.temperatureF }{ forecast.summary }
    ; - } -} - -interface WeatherForecast { - dateFormatted: string; - temperatureC: number; - temperatureF: number; - summary: string; -} diff --git a/templates/ReactSpa/ClientApp/components/Home.tsx b/templates/ReactSpa/ClientApp/components/Home.tsx deleted file mode 100644 index 9f68e05c..00000000 --- a/templates/ReactSpa/ClientApp/components/Home.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import * as React from 'react'; - -export class Home extends React.Component { - public render() { - return
    -

    Hello, world!

    -

    Welcome to your new single-page application, built with:

    -
    -

    To help you get started, we've also set up:

    -
      -
    • Client-side navigation. For example, click Counter then Back to return here.
    • -
    • Webpack dev middleware. In development mode, there's no need to run the webpack build tool. Your client-side resources are dynamically built on demand. Updates are available as soon as you modify any file.
    • -
    • Hot module replacement. In development mode, you don't even need to reload the page after making most changes. Within seconds of saving changes to files, rebuilt React components will be injected directly into your running application, preserving its live state.
    • -
    • Efficient production builds. In production mode, development-time features are disabled, and the webpack build tool produces minified static CSS and JavaScript files.
    • -
    -

    Going further

    -

    - For larger applications, or for server-side prerendering (i.e., for isomorphic or universal applications), you should consider using a Flux/Redux-like architecture. - You can generate an ASP.NET Core application with React and Redux using dotnet new aspnet/spa/reactredux instead of using this template. -

    -
    ; - } -} diff --git a/templates/ReactSpa/ClientApp/components/Layout.tsx b/templates/ReactSpa/ClientApp/components/Layout.tsx deleted file mode 100644 index b9f877bd..00000000 --- a/templates/ReactSpa/ClientApp/components/Layout.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import * as React from 'react'; -import { NavMenu } from './NavMenu'; - -export interface LayoutProps { - body: React.ReactElement; -} - -export class Layout extends React.Component { - public render() { - return
    -
    -
    - -
    -
    - { this.props.body } -
    -
    -
    ; - } -} diff --git a/templates/ReactSpa/ClientApp/components/NavMenu.tsx b/templates/ReactSpa/ClientApp/components/NavMenu.tsx deleted file mode 100644 index e3158f61..00000000 --- a/templates/ReactSpa/ClientApp/components/NavMenu.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import * as React from 'react'; -import { Link } from 'react-router'; - -export class NavMenu extends React.Component { - public render() { - return
    -
    -
    - - WebApplicationBasic -
    -
    -
    -
      -
    • - - Home - -
    • -
    • - - Counter - -
    • -
    • - - Fetch data - -
    • -
    -
    -
    -
    ; - } -} diff --git a/templates/ReactSpa/ClientApp/css/site.css b/templates/ReactSpa/ClientApp/css/site.css deleted file mode 100755 index 3058af68..00000000 --- a/templates/ReactSpa/ClientApp/css/site.css +++ /dev/null @@ -1,66 +0,0 @@ -.main-nav li .glyphicon { - margin-right: 10px; -} - -/* Highlighting rules for nav menu items */ -.main-nav li a.active, -.main-nav li a.active:hover, -.main-nav li a.active:focus { - background-color: #4189C7; - color: white; -} - -/* Keep the nav menu independent of scrolling and on top of other items */ -.main-nav { - position: fixed; - top: 0; - left: 0; - right: 0; - z-index: 1; -} - -@media (max-width: 767px) { - /* On small screens, the nav menu spans the full width of the screen. Leave a space for it. */ - body { - padding-top: 50px; - } -} - -@media (min-width: 768px) { - /* On small screens, convert the nav menu to a vertical sidebar */ - .main-nav { - height: 100%; - width: calc(25% - 20px); - } - .main-nav .navbar { - border-radius: 0px; - border-width: 0px; - height: 100%; - } - .main-nav .navbar-header { - float: none; - } - .main-nav .navbar-collapse { - border-top: 1px solid #444; - padding: 0px; - } - .main-nav .navbar ul { - float: none; - } - .main-nav .navbar li { - float: none; - font-size: 15px; - margin: 6px; - } - .main-nav .navbar li a { - padding: 10px 16px; - border-radius: 4px; - } - .main-nav .navbar a { - /* If a menu item's text is too long, truncate it */ - width: 100%; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } -} diff --git a/templates/ReactSpa/ClientApp/routes.tsx b/templates/ReactSpa/ClientApp/routes.tsx deleted file mode 100644 index 6084614a..00000000 --- a/templates/ReactSpa/ClientApp/routes.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import * as React from 'react'; -import { Router, Route, HistoryBase } from 'react-router'; -import { Layout } from './components/Layout'; -import { Home } from './components/Home'; -import { FetchData } from './components/FetchData'; -import { Counter } from './components/Counter'; - -export default - - - -; diff --git a/templates/ReactSpa/Controllers/HomeController.cs b/templates/ReactSpa/Controllers/HomeController.cs deleted file mode 100755 index 9d75da88..00000000 --- a/templates/ReactSpa/Controllers/HomeController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace WebApplicationBasic.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - - public IActionResult Error() - { - return View(); - } - } -} diff --git a/templates/ReactSpa/Controllers/SampleDataController.cs b/templates/ReactSpa/Controllers/SampleDataController.cs deleted file mode 100644 index 1f46d127..00000000 --- a/templates/ReactSpa/Controllers/SampleDataController.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace WebApplicationBasic.Controllers -{ - [Route("api/[controller]")] - public class SampleDataController : Controller - { - private static string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - [HttpGet("[action]")] - public IEnumerable WeatherForecasts() - { - var rng = new Random(); - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - DateFormatted = DateTime.Now.AddDays(index).ToString("d"), - TemperatureC = rng.Next(-20, 55), - Summary = Summaries[rng.Next(Summaries.Length)] - }); - } - - public class WeatherForecast - { - public string DateFormatted { get; set; } - public int TemperatureC { get; set; } - public string Summary { get; set; } - - public int TemperatureF - { - get - { - return 32 + (int)(this.TemperatureC / 0.5556); - } - } - } - } -} diff --git a/templates/ReactSpa/Dockerfile b/templates/ReactSpa/Dockerfile deleted file mode 100644 index 63d7c456..00000000 --- a/templates/ReactSpa/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM microsoft/aspnet:1.0.0-rc1-update1 - -RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list -RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/* - -COPY . /app -WORKDIR /app -RUN ["dnu", "restore"] - -EXPOSE 5000/tcp -ENTRYPOINT ["dnx", "-p", "project.json", "web"] diff --git a/templates/ReactSpa/README.md b/templates/ReactSpa/README.md deleted file mode 100644 index 4e494c9a..00000000 --- a/templates/ReactSpa/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Welcome to ASP.NET 5 - -We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. - -You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) - -## This application consists of: - -* Sample pages using ASP.NET MVC 6 -* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side libraries -* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) - -## How to - -* [Add a Controller and View](http://go.microsoft.com/fwlink/?LinkID=398600) -* [Add an appsetting in config and access it in app.](http://go.microsoft.com/fwlink/?LinkID=699562) -* [Manage User Secrets using Secret Manager.](http://go.microsoft.com/fwlink/?LinkId=699315) -* [Use logging to log a message.](http://go.microsoft.com/fwlink/?LinkId=699316) -* [Add packages using NuGet.](http://go.microsoft.com/fwlink/?LinkId=699317) -* [Add client packages using Bower.](http://go.microsoft.com/fwlink/?LinkId=699318) -* [Target development, staging or production environment.](http://go.microsoft.com/fwlink/?LinkId=699319) - -## Overview - -* [Conceptual overview of what is ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518008) -* [Fundamentals of ASP.NET 5 such as Startup and middleware.](http://go.microsoft.com/fwlink/?LinkId=699320) -* [Working with Data](http://go.microsoft.com/fwlink/?LinkId=398602) -* [Security](http://go.microsoft.com/fwlink/?LinkId=398603) -* [Client side development](http://go.microsoft.com/fwlink/?LinkID=699321) -* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=699322) -* [Read more on the documentation site](http://go.microsoft.com/fwlink/?LinkID=699323) - -## Run & Deploy - -* [Run your app](http://go.microsoft.com/fwlink/?LinkID=517851) -* [Run your app on .NET Core](http://go.microsoft.com/fwlink/?LinkID=517852) -* [Run commands in your project.json](http://go.microsoft.com/fwlink/?LinkID=517853) -* [Publish to Microsoft Azure Web Apps](http://go.microsoft.com/fwlink/?LinkID=398609) - -We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/templates/ReactSpa/ReactSpa.xproj b/templates/ReactSpa/ReactSpa.xproj deleted file mode 100644 index abe5a589..00000000 --- a/templates/ReactSpa/ReactSpa.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - true - - - - e9d1a695-f0e6-46f2-b5e3-72f4af805387 - ReactSpa - ..\..\..\JavaScriptServices.sln\artifacts\obj\$(MSBuildProjectName) - .\bin\ - - - 2.0 - 2018 - - - \ No newline at end of file diff --git a/templates/ReactSpa/Startup.cs b/templates/ReactSpa/Startup.cs deleted file mode 100755 index 6f4babb1..00000000 --- a/templates/ReactSpa/Startup.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.SpaServices.Webpack; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Newtonsoft.Json.Serialization; - -namespace WebApplicationBasic -{ - public class Startup - { - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc().AddJsonOptions(options => - { - options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); - }); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHostingEnvironment env) - { - app.UseDeveloperExceptionPage(); - - if (env.IsDevelopment()) { - app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { - HotModuleReplacement = true, - ReactHotModuleReplacement = true - }); - } - - app.UseStaticFiles(); - loggerFactory.AddConsole(); - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - - routes.MapSpaFallbackRoute( - name: "spa-fallback", - defaults: new { controller = "Home", action = "Index" }); - }); - } - - public static void Main(string[] args) - { - var host = new WebHostBuilder() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseKestrel() - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/templates/ReactSpa/Views/Home/Index.cshtml b/templates/ReactSpa/Views/Home/Index.cshtml deleted file mode 100644 index 139ed8ac..00000000 --- a/templates/ReactSpa/Views/Home/Index.cshtml +++ /dev/null @@ -1,9 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - -
    Loading...
    - -@section scripts { - -} diff --git a/templates/ReactSpa/Views/Shared/Error.cshtml b/templates/ReactSpa/Views/Shared/Error.cshtml deleted file mode 100755 index 473b35d6..00000000 --- a/templates/ReactSpa/Views/Shared/Error.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ViewData["Title"] = "Error"; -} - -

    Error.

    -

    An error occurred while processing your request.

    diff --git a/templates/ReactSpa/Views/Shared/_Layout.cshtml b/templates/ReactSpa/Views/Shared/_Layout.cshtml deleted file mode 100644 index a770ceb4..00000000 --- a/templates/ReactSpa/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - @ViewData["Title"] - WebApplicationBasic - - - - - - - - @RenderBody() - - - @RenderSection("scripts", required: false) - - diff --git a/templates/ReactSpa/Views/_ViewImports.cshtml b/templates/ReactSpa/Views/_ViewImports.cshtml deleted file mode 100755 index e7b4f83f..00000000 --- a/templates/ReactSpa/Views/_ViewImports.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@using WebApplicationBasic -@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" -@addTagHelper "*, Microsoft.AspNetCore.SpaServices" diff --git a/templates/ReactSpa/Views/_ViewStart.cshtml b/templates/ReactSpa/Views/_ViewStart.cshtml deleted file mode 100755 index 820a2f6e..00000000 --- a/templates/ReactSpa/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/templates/ReactSpa/appsettings.json b/templates/ReactSpa/appsettings.json deleted file mode 100755 index e5472e56..00000000 --- a/templates/ReactSpa/appsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Verbose", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/templates/ReactSpa/package.json b/templates/ReactSpa/package.json deleted file mode 100644 index 2b6d0b0a..00000000 --- a/templates/ReactSpa/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "WebApplicationBasic", - "version": "0.0.0", - "devDependencies": { - "aspnet-webpack": "^1.0.2", - "aspnet-webpack-react": "^1.0.0", - "babel-loader": "^6.2.3", - "babel-preset-es2015": "^6.5.0", - "babel-preset-react": "^6.5.0", - "bootstrap": "^3.3.6", - "css-loader": "^0.23.1", - "extendify": "^1.0.0", - "extract-text-webpack-plugin": "^1.0.1", - "file-loader": "^0.8.5", - "jquery": "^2.2.1", - "style-loader": "^0.13.0", - "ts-loader": "^0.8.1", - "typescript": "^1.8.2", - "url-loader": "^0.5.7", - "webpack": "^1.12.14", - "webpack-hot-middleware": "^2.10.0" - }, - "dependencies": { - "babel-core": "^6.5.2", - "react": "^15.0.1", - "react-dom": "^15.0.1", - "react-router": "^2.1.1" - } -} diff --git a/templates/ReactSpa/project.json b/templates/ReactSpa/project.json deleted file mode 100755 index f768ecaf..00000000 --- a/templates/ReactSpa/project.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.0", - "type": "platform" - }, - "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", - "Microsoft.AspNetCore.ReactServices": "1.0.0-*", - "Microsoft.AspNetCore.Diagnostics": "1.0.0", - "Microsoft.AspNetCore.Mvc": "1.0.0", - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", - "Microsoft.AspNetCore.StaticFiles": "1.0.0", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Logging": "1.0.0", - "Microsoft.Extensions.Logging.Console": "1.0.0", - "Microsoft.Extensions.Logging.Debug": "1.0.0", - "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { - "version": "1.0.0-preview2-final", - "type": "build" - } - }, - - "tools": { - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.AspNetCore.Server.IISIntegration.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.EntityFrameworkCore.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - }, - "Microsoft.Extensions.SecretManager.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - }, - "Microsoft.DotNet.Watcher.Tools": "1.0.0-preview2-final" - }, - - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "dotnet5.6", - "dnxcore50", - "portable-net45+win8" - ] - } - }, - - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - - "runtimeOptions": { - "configProperties": { - "System.GC.Server": true - } - }, - - "publishOptions": { - "include": [ - ".babelrc", - "appsettings.json", - "ClientApp", - "node_modules", - "typings", - "Views", - "tsconfig.json", - "tsd.json", - "web.config", - "webpack.*.js", - "wwwroot" - ] - }, - - "scripts": { - "prepublish": [ - "npm install", - "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js", - "node node_modules/webpack/bin/webpack.js" - ], - "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] - }, - - "tooling": { - "defaultNamespace": "WebApplicationBasic" - } -} diff --git a/templates/ReactSpa/template_gitignore b/templates/ReactSpa/template_gitignore deleted file mode 100644 index d410b8bb..00000000 --- a/templates/ReactSpa/template_gitignore +++ /dev/null @@ -1,237 +0,0 @@ -/Properties/launchSettings.json - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -bin/ -Bin/ -obj/ -Obj/ - -# Visual Studio 2015 cache/options directory -.vs/ -/wwwroot/dist/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Microsoft Azure ApplicationInsights config file -ApplicationInsights.config - -# Windows Store app package directory -AppPackages/ -BundleArtifacts/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe - -# FAKE - F# Make -.fake/ diff --git a/templates/ReactSpa/tsconfig.json b/templates/ReactSpa/tsconfig.json deleted file mode 100644 index 39a15ea3..00000000 --- a/templates/ReactSpa/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "node", - "target": "es6", - "jsx": "preserve", - "sourceMap": true, - "skipDefaultLibCheck": true - }, - "exclude": [ - "node_modules" - ] -} diff --git a/templates/ReactSpa/tsd.json b/templates/ReactSpa/tsd.json deleted file mode 100644 index 523893de..00000000 --- a/templates/ReactSpa/tsd.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "version": "v4", - "repo": "borisyankov/DefinitelyTyped", - "ref": "master", - "path": "typings", - "bundle": "typings/tsd.d.ts", - "installed": { - "react/react.d.ts": { - "commit": "dade4414712ce84e3c63393f1aae407e9e7e6af7" - }, - "react-router/react-router.d.ts": { - "commit": "dade4414712ce84e3c63393f1aae407e9e7e6af7" - }, - "react/react-dom.d.ts": { - "commit": "dade4414712ce84e3c63393f1aae407e9e7e6af7" - }, - "react-router/history.d.ts": { - "commit": "dade4414712ce84e3c63393f1aae407e9e7e6af7" - }, - "whatwg-fetch/whatwg-fetch.d.ts": { - "commit": "dade4414712ce84e3c63393f1aae407e9e7e6af7" - } - } -} diff --git a/templates/ReactSpa/typings/react-router/history.d.ts b/templates/ReactSpa/typings/react-router/history.d.ts deleted file mode 100644 index 1b5c6dfa..00000000 --- a/templates/ReactSpa/typings/react-router/history.d.ts +++ /dev/null @@ -1,192 +0,0 @@ -// Type definitions for history v1.13.1 -// Project: https://github.com/rackt/history -// Definitions by: Sergey Buturlakin -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -declare namespace HistoryModule { - - // types based on https://github.com/rackt/history/blob/master/docs/Terms.md - - type Action = string - - type BeforeUnloadHook = () => string | boolean - - type CreateHistory = (options?: HistoryOptions) => T - - type CreateHistoryEnhancer = (createHistory: CreateHistory) => CreateHistory - - interface History { - listenBefore(hook: TransitionHook): Function - listen(listener: LocationListener): Function - transitionTo(location: Location): void - pushState(state: LocationState, path: Path): void - replaceState(state: LocationState, path: Path): void - push(path: Path): void - replace(path: Path): void - go(n: number): void - goBack(): void - goForward(): void - createKey(): LocationKey - createPath(path: Path): Path - createHref(path: Path): Href - createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location - - /** @deprecated use location.key to save state instead */ - setState(state: LocationState): void - /** @deprecated use listenBefore instead */ - registerTransitionHook(hook: TransitionHook): void - /** @deprecated use the callback returned from listenBefore instead */ - unregisterTransitionHook(hook: TransitionHook): void - } - - type HistoryOptions = Object - - type Href = string - - type Location = { - pathname: Pathname - search: QueryString - query: Query - state: LocationState - action: Action - key: LocationKey - } - - type LocationKey = string - - type LocationListener = (location: Location) => void - - type LocationState = Object - - type Path = string // Pathname + QueryString - - type Pathname = string - - type Query = Object - - type QueryString = string - - type TransitionHook = (location: Location, callback: Function) => any - - - interface HistoryBeforeUnload { - listenBeforeUnload(hook: BeforeUnloadHook): Function - } - - interface HistoryQueries { - pushState(state: LocationState, pathname: Pathname | Path, query?: Query): void - replaceState(state: LocationState, pathname: Pathname | Path, query?: Query): void - createPath(path: Path, query?: Query): Path - createHref(path: Path, query?: Query): Href - } - - - // Global usage, without modules, needs the small trick, because lib.d.ts - // already has `history` and `History` global definitions: - // var createHistory = ((window as any).History as HistoryModule.Module).createHistory; - interface Module { - createHistory: CreateHistory - createHashHistory: CreateHistory - createMemoryHistory: CreateHistory - createLocation(path?: Path, state?: LocationState, action?: Action, key?: LocationKey): Location - useBasename(createHistory: CreateHistory): CreateHistory - useBeforeUnload(createHistory: CreateHistory): CreateHistory - useQueries(createHistory: CreateHistory): CreateHistory - actions: { - PUSH: string - REPLACE: string - POP: string - } - } - -} - - -declare module "history/lib/createBrowserHistory" { - - export default function createBrowserHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History - -} - - -declare module "history/lib/createHashHistory" { - - export default function createHashHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History - -} - - -declare module "history/lib/createMemoryHistory" { - - export default function createMemoryHistory(options?: HistoryModule.HistoryOptions): HistoryModule.History - -} - - -declare module "history/lib/createLocation" { - - export default function createLocation(path?: HistoryModule.Path, state?: HistoryModule.LocationState, action?: HistoryModule.Action, key?: HistoryModule.LocationKey): HistoryModule.Location - -} - - -declare module "history/lib/useBasename" { - - export default function useBasename(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory - -} - - -declare module "history/lib/useBeforeUnload" { - - export default function useBeforeUnload(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory - -} - - -declare module "history/lib/useQueries" { - - export default function useQueries(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory - -} - - -declare module "history/lib/actions" { - - export const PUSH: string - - export const REPLACE: string - - export const POP: string - - export default { - PUSH, - REPLACE, - POP - } - -} - - -declare module "history" { - - export { default as createHistory } from "history/lib/createBrowserHistory" - - export { default as createHashHistory } from "history/lib/createHashHistory" - - export { default as createMemoryHistory } from "history/lib/createMemoryHistory" - - export { default as createLocation } from "history/lib/createLocation" - - export { default as useBasename } from "history/lib/useBasename" - - export { default as useBeforeUnload } from "history/lib/useBeforeUnload" - - export { default as useQueries } from "history/lib/useQueries" - - import * as Actions from "history/lib/actions" - - export { Actions } - -} diff --git a/templates/ReactSpa/typings/react-router/react-router.d.ts b/templates/ReactSpa/typings/react-router/react-router.d.ts deleted file mode 100644 index abed5eb6..00000000 --- a/templates/ReactSpa/typings/react-router/react-router.d.ts +++ /dev/null @@ -1,474 +0,0 @@ -// Type definitions for react-router v2.0.0-rc5 -// Project: https://github.com/rackt/react-router -// Definitions by: Sergey Buturlakin , Yuichi Murata , Václav Ostrožlík -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -/// -/// - - -declare namespace ReactRouter { - - import React = __React - - import H = HistoryModule - - // types based on https://github.com/rackt/react-router/blob/master/docs/Glossary.md - - type Component = React.ReactType - - type EnterHook = (nextState: RouterState, replaceState: RedirectFunction, callback?: Function) => any - - type LeaveHook = () => any - - type Params = Object - - type ParseQueryString = (queryString: H.QueryString) => H.Query - - type RedirectFunction = (state: H.LocationState, pathname: H.Pathname | H.Path, query?: H.Query) => void - - type RouteComponent = Component - - // use the following interface in an app code to get access to route param values, history, location... - // interface MyComponentProps extends ReactRouter.RouteComponentProps<{}, { id: number }> {} - // somewhere in MyComponent - // ... - // let id = this.props.routeParams.id - // ... - // this.props.history. ... - // ... - interface RouteComponentProps { - history?: History - location?: H.Location - params?: P - route?: PlainRoute - routeParams?: R - routes?: PlainRoute[] - children?: React.ReactElement - } - - type RouteComponents = { [key: string]: RouteComponent } - - type RouteConfig = React.ReactNode | PlainRoute | PlainRoute[] - - type RouteHook = (nextLocation?: H.Location) => any - - type RoutePattern = string - - type StringifyQuery = (queryObject: H.Query) => H.QueryString - - type RouterListener = (error: Error, nextState: RouterState) => void - - interface RouterState { - location: H.Location - routes: PlainRoute[] - params: Params - components: RouteComponent[] - } - - - interface HistoryBase extends H.History { - routes: PlainRoute[] - parseQueryString?: ParseQueryString - stringifyQuery?: StringifyQuery - } - - type History = HistoryBase & H.HistoryQueries & HistoryRoutes - const browserHistory: History; - const hashHistory: History; - - /* components */ - - interface RouterProps extends React.Props { - history?: H.History - routes?: RouteConfig // alias for children - createElement?: (component: RouteComponent, props: Object) => any - onError?: (error: any) => any - onUpdate?: () => any - parseQueryString?: ParseQueryString - stringifyQuery?: StringifyQuery - } - interface Router extends React.ComponentClass {} - interface RouterElement extends React.ReactElement {} - const Router: Router - - - interface LinkProps extends React.HTMLAttributes, React.Props { - activeStyle?: React.CSSProperties - activeClassName?: string - onlyActiveOnIndex?: boolean - to: RoutePattern - query?: H.Query - state?: H.LocationState - } - interface Link extends React.ComponentClass {} - interface LinkElement extends React.ReactElement {} - const Link: Link - - - const IndexLink: Link - - - interface RouterContextProps extends React.Props { - history?: H.History - router: Router - createElement: (component: RouteComponent, props: Object) => any - location: H.Location - routes: RouteConfig - params: Params - components?: RouteComponent[] - } - interface RouterContext extends React.ComponentClass {} - interface RouterContextElement extends React.ReactElement { - history?: H.History - location: H.Location - router?: Router - } - const RouterContext: RouterContext - - - /* components (configuration) */ - - interface RouteProps extends React.Props { - path?: RoutePattern - component?: RouteComponent - components?: RouteComponents - getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void - getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void - onEnter?: EnterHook - onLeave?: LeaveHook - getIndexRoute?: (location: H.Location, cb: (error: any, indexRoute: RouteConfig) => void) => void - getChildRoutes?: (location: H.Location, cb: (error: any, childRoutes: RouteConfig) => void) => void - } - interface Route extends React.ComponentClass {} - interface RouteElement extends React.ReactElement {} - const Route: Route - - - interface PlainRoute { - path?: RoutePattern - component?: RouteComponent - components?: RouteComponents - getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void - getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void - onEnter?: EnterHook - onLeave?: LeaveHook - indexRoute?: PlainRoute - getIndexRoute?: (location: H.Location, cb: (error: any, indexRoute: RouteConfig) => void) => void - childRoutes?: PlainRoute[] - getChildRoutes?: (location: H.Location, cb: (error: any, childRoutes: RouteConfig) => void) => void - } - - - interface RedirectProps extends React.Props { - path?: RoutePattern - from?: RoutePattern // alias for path - to: RoutePattern - query?: H.Query - state?: H.LocationState - } - interface Redirect extends React.ComponentClass {} - interface RedirectElement extends React.ReactElement {} - const Redirect: Redirect - - - interface IndexRouteProps extends React.Props { - component?: RouteComponent - components?: RouteComponents - getComponent?: (location: H.Location, cb: (error: any, component?: RouteComponent) => void) => void - getComponents?: (location: H.Location, cb: (error: any, components?: RouteComponents) => void) => void - onEnter?: EnterHook - onLeave?: LeaveHook - } - interface IndexRoute extends React.ComponentClass {} - interface IndexRouteElement extends React.ReactElement {} - const IndexRoute: IndexRoute - - - interface IndexRedirectProps extends React.Props { - to: RoutePattern - query?: H.Query - state?: H.LocationState - } - interface IndexRedirect extends React.ComponentClass {} - interface IndexRedirectElement extends React.ReactElement {} - const IndexRedirect: IndexRedirect - - - /* mixins */ - - interface HistoryMixin { - history: History - } - const History: React.Mixin - - - interface LifecycleMixin { - routerWillLeave(nextLocation: H.Location): string | boolean - } - const Lifecycle: React.Mixin - - - const RouteContext: React.Mixin - - - /* utils */ - - interface HistoryRoutes { - listen(listener: RouterListener): Function - listenBeforeLeavingRoute(route: PlainRoute, hook: RouteHook): void - match(location: H.Location, callback: (error: any, nextState: RouterState, nextLocation: H.Location) => void): void - isActive(pathname: H.Pathname, query?: H.Query, indexOnly?: boolean): boolean - } - - function useRoutes(createHistory: HistoryModule.CreateHistory): HistoryModule.CreateHistory - - - function createRoutes(routes: RouteConfig): PlainRoute[] - - - interface MatchArgs { - routes?: RouteConfig - history?: H.History - location?: H.Location - parseQueryString?: ParseQueryString - stringifyQuery?: StringifyQuery - } - interface MatchState extends RouterState { - history: History - } - function match(args: MatchArgs, cb: (error: any, nextLocation: H.Location, nextState: MatchState) => void): void - -} - - -declare module "react-router/lib/Router" { - - export default ReactRouter.Router - -} - - -declare module "react-router/lib/Link" { - - export default ReactRouter.Link - -} - - -declare module "react-router/lib/IndexLink" { - - export default ReactRouter.IndexLink - -} - - -declare module "react-router/lib/IndexRedirect" { - - export default ReactRouter.IndexRedirect - -} - - -declare module "react-router/lib/IndexRoute" { - - export default ReactRouter.IndexRoute - -} - - -declare module "react-router/lib/Redirect" { - - export default ReactRouter.Redirect - -} - - -declare module "react-router/lib/Route" { - - export default ReactRouter.Route - -} - - -declare module "react-router/lib/History" { - - export default ReactRouter.History - -} - - -declare module "react-router/lib/Lifecycle" { - - export default ReactRouter.Lifecycle - -} - - -declare module "react-router/lib/RouteContext" { - - export default ReactRouter.RouteContext - -} - - -declare module "react-router/lib/useRoutes" { - - export default ReactRouter.useRoutes - -} - -declare module "react-router/lib/PatternUtils" { - - export function formatPattern(pattern: string, params: {}): string; - -} - -declare module "react-router/lib/RouteUtils" { - - type E = __React.ReactElement - - export function isReactChildren(object: E | E[]): boolean - - export function createRouteFromReactElement(element: E): ReactRouter.PlainRoute - - export function createRoutesFromReactChildren(children: E | E[], parentRoute: ReactRouter.PlainRoute): ReactRouter.PlainRoute[] - - export import createRoutes = ReactRouter.createRoutes - -} - - -declare module "react-router/lib/RouterContext" { - - export default ReactRouter.RouterContext - -} - - -declare module "react-router/lib/PropTypes" { - - import React = __React - - export function falsy(props: any, propName: string, componentName: string): Error; - - export const history: React.Requireable - - export const location: React.Requireable - - export const component: React.Requireable - - export const components: React.Requireable - - export const route: React.Requireable - - export const routes: React.Requireable - - export default { - falsy, - history, - location, - component, - components, - route - } - -} - -declare module "react-router/lib/browserHistory" { - export default ReactRouter.browserHistory; -} - -declare module "react-router/lib/hashHistory" { - export default ReactRouter.hashHistory; -} - -declare module "react-router/lib/match" { - - export default ReactRouter.match - -} - - -declare module "react-router" { - - import Router from "react-router/lib/Router" - - import Link from "react-router/lib/Link" - - import IndexLink from "react-router/lib/IndexLink" - - import IndexRedirect from "react-router/lib/IndexRedirect" - - import IndexRoute from "react-router/lib/IndexRoute" - - import Redirect from "react-router/lib/Redirect" - - import Route from "react-router/lib/Route" - - import History from "react-router/lib/History" - - import Lifecycle from "react-router/lib/Lifecycle" - - import RouteContext from "react-router/lib/RouteContext" - - import browserHistory from "react-router/lib/browserHistory" - - import hashHistory from "react-router/lib/hashHistory" - - import useRoutes from "react-router/lib/useRoutes" - - import { createRoutes } from "react-router/lib/RouteUtils" - - import { formatPattern } from "react-router/lib/PatternUtils" - - import RouterContext from "react-router/lib/RouterContext" - - import PropTypes from "react-router/lib/PropTypes" - - import match from "react-router/lib/match" - - // PlainRoute is defined in the API documented at: - // https://github.com/rackt/react-router/blob/master/docs/API.md - // but not included in any of the .../lib modules above. - export type PlainRoute = ReactRouter.PlainRoute - - // The following definitions are also very useful to export - // because by using these types lots of potential type errors - // can be exposed: - export type EnterHook = ReactRouter.EnterHook - export type LeaveHook = ReactRouter.LeaveHook - export type ParseQueryString = ReactRouter.ParseQueryString - export type RedirectFunction = ReactRouter.RedirectFunction - export type RouteComponentProps = ReactRouter.RouteComponentProps; - export type RouteHook = ReactRouter.RouteHook - export type StringifyQuery = ReactRouter.StringifyQuery - export type RouterListener = ReactRouter.RouterListener - export type RouterState = ReactRouter.RouterState - export type HistoryBase = ReactRouter.HistoryBase - - export { - Router, - Link, - IndexLink, - IndexRedirect, - IndexRoute, - Redirect, - Route, - History, - browserHistory, - hashHistory, - Lifecycle, - RouteContext, - useRoutes, - createRoutes, - formatPattern, - RouterContext, - PropTypes, - match - } - - export default Router - -} diff --git a/templates/ReactSpa/typings/react/react-dom.d.ts b/templates/ReactSpa/typings/react/react-dom.d.ts deleted file mode 100644 index 80a0c604..00000000 --- a/templates/ReactSpa/typings/react/react-dom.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Type definitions for React v0.14 (react-dom) -// Project: http://facebook.github.io/react/ -// Definitions by: Asana , AssureSign , Microsoft -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare namespace __React { - namespace __DOM { - function findDOMNode(instance: ReactInstance): E; - function findDOMNode(instance: ReactInstance): Element; - - function render

    ( - element: DOMElement

    , - container: Element, - callback?: (element: Element) => any): Element; - function render( - element: ClassicElement

    , - container: Element, - callback?: (component: ClassicComponent) => any): ClassicComponent; - function render( - element: ReactElement

    , - container: Element, - callback?: (component: Component) => any): Component; - - function unmountComponentAtNode(container: Element): boolean; - - var version: string; - - function unstable_batchedUpdates(callback: (a: A, b: B) => any, a: A, b: B): void; - function unstable_batchedUpdates(callback: (a: A) => any, a: A): void; - function unstable_batchedUpdates(callback: () => any): void; - - function unstable_renderSubtreeIntoContainer

    ( - parentComponent: Component, - nextElement: DOMElement

    , - container: Element, - callback?: (element: Element) => any): Element; - function unstable_renderSubtreeIntoContainer( - parentComponent: Component, - nextElement: ClassicElement

    , - container: Element, - callback?: (component: ClassicComponent) => any): ClassicComponent; - function unstable_renderSubtreeIntoContainer( - parentComponent: Component, - nextElement: ReactElement

    , - container: Element, - callback?: (component: Component) => any): Component; - } - - namespace __DOMServer { - function renderToString(element: ReactElement): string; - function renderToStaticMarkup(element: ReactElement): string; - var version: string; - } -} - -declare module "react-dom" { - import DOM = __React.__DOM; - export = DOM; -} - -declare module "react-dom/server" { - import DOMServer = __React.__DOMServer; - export = DOMServer; -} diff --git a/templates/ReactSpa/typings/react/react.d.ts b/templates/ReactSpa/typings/react/react.d.ts deleted file mode 100644 index 5753731b..00000000 --- a/templates/ReactSpa/typings/react/react.d.ts +++ /dev/null @@ -1,2281 +0,0 @@ -// Type definitions for React v0.14 -// Project: http://facebook.github.io/react/ -// Definitions by: Asana , AssureSign , Microsoft -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare namespace __React { - - // - // React Elements - // ---------------------------------------------------------------------- - - type ReactType = string | ComponentClass | StatelessComponent; - - interface ReactElement

    > { - type: string | ComponentClass

    | StatelessComponent

    ; - props: P; - key: string | number; - ref: string | ((component: Component | Element) => any); - } - - interface ClassicElement

    extends ReactElement

    { - type: ClassicComponentClass

    ; - ref: string | ((component: ClassicComponent) => any); - } - - interface DOMElement

    > extends ReactElement

    { - type: string; - ref: string | ((element: Element) => any); - } - - interface ReactHTMLElement extends DOMElement> { - ref: string | ((element: HTMLElement) => any); - } - - interface ReactSVGElement extends DOMElement { - ref: string | ((element: SVGElement) => any); - } - - // - // Factories - // ---------------------------------------------------------------------- - - interface Factory

    { - (props?: P, ...children: ReactNode[]): ReactElement

    ; - } - - interface ClassicFactory

    extends Factory

    { - (props?: P, ...children: ReactNode[]): ClassicElement

    ; - } - - interface DOMFactory

    > extends Factory

    { - (props?: P, ...children: ReactNode[]): DOMElement

    ; - } - - type HTMLFactory = DOMFactory>; - type SVGFactory = DOMFactory; - - // - // React Nodes - // http://facebook.github.io/react/docs/glossary.html - // ---------------------------------------------------------------------- - - type ReactText = string | number; - type ReactChild = ReactElement | ReactText; - - // Should be Array but type aliases cannot be recursive - type ReactFragment = {} | Array; - type ReactNode = ReactChild | ReactFragment | boolean; - - // - // Top Level API - // ---------------------------------------------------------------------- - - function createClass(spec: ComponentSpec): ClassicComponentClass

    ; - - function createFactory

    (type: string): DOMFactory

    ; - function createFactory

    (type: ClassicComponentClass

    ): ClassicFactory

    ; - function createFactory

    (type: ComponentClass

    | StatelessComponent

    ): Factory

    ; - - function createElement

    ( - type: string, - props?: P, - ...children: ReactNode[]): DOMElement

    ; - function createElement

    ( - type: ClassicComponentClass

    , - props?: P, - ...children: ReactNode[]): ClassicElement

    ; - function createElement

    ( - type: ComponentClass

    | StatelessComponent

    , - props?: P, - ...children: ReactNode[]): ReactElement

    ; - - function cloneElement

    ( - element: DOMElement

    , - props?: P, - ...children: ReactNode[]): DOMElement

    ; - function cloneElement

    ( - element: ClassicElement

    , - props?: P, - ...children: ReactNode[]): ClassicElement

    ; - function cloneElement

    ( - element: ReactElement

    , - props?: P, - ...children: ReactNode[]): ReactElement

    ; - - function isValidElement(object: {}): boolean; - - var DOM: ReactDOM; - var PropTypes: ReactPropTypes; - var Children: ReactChildren; - - // - // Component API - // ---------------------------------------------------------------------- - - type ReactInstance = Component | Element; - - // Base component for plain JS classes - class Component implements ComponentLifecycle { - constructor(props?: P, context?: any); - setState(f: (prevState: S, props: P) => S, callback?: () => any): void; - setState(state: S, callback?: () => any): void; - forceUpdate(callBack?: () => any): void; - render(): JSX.Element; - props: P; - state: S; - context: {}; - refs: { - [key: string]: ReactInstance - }; - } - - interface ClassicComponent extends Component { - replaceState(nextState: S, callback?: () => any): void; - isMounted(): boolean; - getInitialState?(): S; - } - - interface ChildContextProvider { - getChildContext(): CC; - } - - // - // Class Interfaces - // ---------------------------------------------------------------------- - - interface StatelessComponent

    { - (props?: P, context?: any): ReactElement; - propTypes?: ValidationMap

    ; - contextTypes?: ValidationMap; - defaultProps?: P; - displayName?: string; - } - - interface ComponentClass

    { - new(props?: P, context?: any): Component; - propTypes?: ValidationMap

    ; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap; - defaultProps?: P; - } - - interface ClassicComponentClass

    extends ComponentClass

    { - new(props?: P, context?: any): ClassicComponent; - getDefaultProps?(): P; - displayName?: string; - } - - // - // Component Specs and Lifecycle - // ---------------------------------------------------------------------- - - interface ComponentLifecycle { - componentWillMount?(): void; - componentDidMount?(): void; - componentWillReceiveProps?(nextProps: P, nextContext: any): void; - shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; - componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; - componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; - componentWillUnmount?(): void; - } - - interface Mixin extends ComponentLifecycle { - mixins?: Mixin; - statics?: { - [key: string]: any; - }; - - displayName?: string; - propTypes?: ValidationMap; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap; - - getDefaultProps?(): P; - getInitialState?(): S; - } - - interface ComponentSpec extends Mixin { - render(): ReactElement; - - [propertyName: string]: any; - } - - // - // Event System - // ---------------------------------------------------------------------- - - interface SyntheticEvent { - bubbles: boolean; - cancelable: boolean; - currentTarget: EventTarget; - defaultPrevented: boolean; - eventPhase: number; - isTrusted: boolean; - nativeEvent: Event; - preventDefault(): void; - stopPropagation(): void; - target: EventTarget; - timeStamp: Date; - type: string; - } - - interface ClipboardEvent extends SyntheticEvent { - clipboardData: DataTransfer; - } - - interface CompositionEvent extends SyntheticEvent { - data: string; - } - - interface DragEvent extends SyntheticEvent { - dataTransfer: DataTransfer; - } - - interface FocusEvent extends SyntheticEvent { - relatedTarget: EventTarget; - } - - interface FormEvent extends SyntheticEvent { - } - - interface KeyboardEvent extends SyntheticEvent { - altKey: boolean; - charCode: number; - ctrlKey: boolean; - getModifierState(key: string): boolean; - key: string; - keyCode: number; - locale: string; - location: number; - metaKey: boolean; - repeat: boolean; - shiftKey: boolean; - which: number; - } - - interface MouseEvent extends SyntheticEvent { - altKey: boolean; - button: number; - buttons: number; - clientX: number; - clientY: number; - ctrlKey: boolean; - getModifierState(key: string): boolean; - metaKey: boolean; - pageX: number; - pageY: number; - relatedTarget: EventTarget; - screenX: number; - screenY: number; - shiftKey: boolean; - } - - interface TouchEvent extends SyntheticEvent { - altKey: boolean; - changedTouches: TouchList; - ctrlKey: boolean; - getModifierState(key: string): boolean; - metaKey: boolean; - shiftKey: boolean; - targetTouches: TouchList; - touches: TouchList; - } - - interface UIEvent extends SyntheticEvent { - detail: number; - view: AbstractView; - } - - interface WheelEvent extends SyntheticEvent { - deltaMode: number; - deltaX: number; - deltaY: number; - deltaZ: number; - } - - // - // Event Handler Types - // ---------------------------------------------------------------------- - - interface EventHandler { - (event: E): void; - } - - type ReactEventHandler = EventHandler; - - type ClipboardEventHandler = EventHandler; - type CompositionEventHandler = EventHandler; - type DragEventHandler = EventHandler; - type FocusEventHandler = EventHandler; - type FormEventHandler = EventHandler; - type KeyboardEventHandler = EventHandler; - type MouseEventHandler = EventHandler; - type TouchEventHandler = EventHandler; - type UIEventHandler = EventHandler; - type WheelEventHandler = EventHandler; - - // - // Props / DOM Attributes - // ---------------------------------------------------------------------- - - interface Props { - children?: ReactNode; - key?: string | number; - ref?: string | ((component: T) => any); - } - - interface HTMLProps extends HTMLAttributes, Props { - } - - interface SVGProps extends SVGAttributes, Props { - } - - interface DOMAttributes { - dangerouslySetInnerHTML?: { - __html: string; - }; - - // Clipboard Events - onCopy?: ClipboardEventHandler; - onCut?: ClipboardEventHandler; - onPaste?: ClipboardEventHandler; - - // Composition Events - onCompositionEnd?: CompositionEventHandler; - onCompositionStart?: CompositionEventHandler; - onCompositionUpdate?: CompositionEventHandler; - - // Focus Events - onFocus?: FocusEventHandler; - onBlur?: FocusEventHandler; - - // Form Events - onChange?: FormEventHandler; - onInput?: FormEventHandler; - onSubmit?: FormEventHandler; - - // Image Events - onLoad?: ReactEventHandler; - onError?: ReactEventHandler; // also a Media Event - - // Keyboard Events - onKeyDown?: KeyboardEventHandler; - onKeyPress?: KeyboardEventHandler; - onKeyUp?: KeyboardEventHandler; - - // Media Events - onAbort?: ReactEventHandler; - onCanPlay?: ReactEventHandler; - onCanPlayThrough?: ReactEventHandler; - onDurationChange?: ReactEventHandler; - onEmptied?: ReactEventHandler; - onEncrypted?: ReactEventHandler; - onEnded?: ReactEventHandler; - onLoadedData?: ReactEventHandler; - onLoadedMetadata?: ReactEventHandler; - onLoadStart?: ReactEventHandler; - onPause?: ReactEventHandler; - onPlay?: ReactEventHandler; - onPlaying?: ReactEventHandler; - onProgress?: ReactEventHandler; - onRateChange?: ReactEventHandler; - onSeeked?: ReactEventHandler; - onSeeking?: ReactEventHandler; - onStalled?: ReactEventHandler; - onSuspend?: ReactEventHandler; - onTimeUpdate?: ReactEventHandler; - onVolumeChange?: ReactEventHandler; - onWaiting?: ReactEventHandler; - - // MouseEvents - onClick?: MouseEventHandler; - onContextMenu?: MouseEventHandler; - onDoubleClick?: MouseEventHandler; - onDrag?: DragEventHandler; - onDragEnd?: DragEventHandler; - onDragEnter?: DragEventHandler; - onDragExit?: DragEventHandler; - onDragLeave?: DragEventHandler; - onDragOver?: DragEventHandler; - onDragStart?: DragEventHandler; - onDrop?: DragEventHandler; - onMouseDown?: MouseEventHandler; - onMouseEnter?: MouseEventHandler; - onMouseLeave?: MouseEventHandler; - onMouseMove?: MouseEventHandler; - onMouseOut?: MouseEventHandler; - onMouseOver?: MouseEventHandler; - onMouseUp?: MouseEventHandler; - - // Selection Events - onSelect?: ReactEventHandler; - - // Touch Events - onTouchCancel?: TouchEventHandler; - onTouchEnd?: TouchEventHandler; - onTouchMove?: TouchEventHandler; - onTouchStart?: TouchEventHandler; - - // UI Events - onScroll?: UIEventHandler; - - // Wheel Events - onWheel?: WheelEventHandler; - } - - // This interface is not complete. Only properties accepting - // unitless numbers are listed here (see CSSProperty.js in React) - interface CSSProperties { - boxFlex?: number; - boxFlexGroup?: number; - columnCount?: number; - flex?: number | string; - flexGrow?: number; - flexShrink?: number; - fontWeight?: number | string; - lineClamp?: number; - lineHeight?: number | string; - opacity?: number; - order?: number; - orphans?: number; - widows?: number; - zIndex?: number; - zoom?: number; - - fontSize?: number | string; - - // SVG-related properties - fillOpacity?: number; - strokeOpacity?: number; - strokeWidth?: number; - - // Remaining properties auto-extracted from http://docs.webplatform.org. - // License: http://docs.webplatform.org/wiki/Template:CC-by-3.0 - /** - * Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis. - */ - alignContent?: any; - - /** - * Sets the default alignment in the cross axis for all of the flex container's items, including anonymous flex items, similarly to how justify-content aligns items along the main axis. - */ - alignItems?: any; - - /** - * Allows the default alignment to be overridden for individual flex items. - */ - alignSelf?: any; - - /** - * This property allows precise alignment of elements, such as graphics, that do not have a baseline-table or lack the desired baseline in their baseline-table. With the alignment-adjust property, the position of the baseline identified by the alignment-baseline can be explicitly determined. It also determines precisely the alignment point for each glyph within a textual element. - */ - alignmentAdjust?: any; - - alignmentBaseline?: any; - - /** - * Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied. - */ - animationDelay?: any; - - /** - * Defines whether an animation should run in reverse on some or all cycles. - */ - animationDirection?: any; - - /** - * Specifies how many times an animation cycle should play. - */ - animationIterationCount?: any; - - /** - * Defines the list of animations that apply to the element. - */ - animationName?: any; - - /** - * Defines whether an animation is running or paused. - */ - animationPlayState?: any; - - /** - * Allows changing the style of any element to platform-based interface elements or vice versa. - */ - appearance?: any; - - /** - * Determines whether or not the “back” side of a transformed element is visible when facing the viewer. - */ - backfaceVisibility?: any; - - /** - * This property describes how the element's background images should blend with each other and the element's background color. - * The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the corresponding element of background-image. If a property doesn’t have enough comma-separated values to match the number of layers, the UA must calculate its used value by repeating the list of values until there are enough. - */ - backgroundBlendMode?: any; - - backgroundColor?: any; - - backgroundComposite?: any; - - /** - * Applies one or more background images to an element. These can be any valid CSS image, including url() paths to image files or CSS gradients. - */ - backgroundImage?: any; - - /** - * Specifies what the background-position property is relative to. - */ - backgroundOrigin?: any; - - /** - * Sets the horizontal position of a background image. - */ - backgroundPositionX?: any; - - /** - * Background-repeat defines if and how background images will be repeated after they have been sized and positioned - */ - backgroundRepeat?: any; - - /** - * Obsolete - spec retired, not implemented. - */ - baselineShift?: any; - - /** - * Non standard. Sets or retrieves the location of the Dynamic HTML (DHTML) behavior. - */ - behavior?: any; - - /** - * Shorthand property that defines the different properties of all four sides of an element's border in a single declaration. It can be used to set border-width, border-style and border-color, or a subset of these. - */ - border?: any; - - /** - * Defines the shape of the border of the bottom-left corner. - */ - borderBottomLeftRadius?: any; - - /** - * Defines the shape of the border of the bottom-right corner. - */ - borderBottomRightRadius?: any; - - /** - * Sets the width of an element's bottom border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - */ - borderBottomWidth?: any; - - /** - * Border-collapse can be used for collapsing the borders between table cells - */ - borderCollapse?: any; - - /** - * The CSS border-color property sets the color of an element's four borders. This property can have from one to four values, made up of the elementary properties: • border-top-color - * • border-right-color - * • border-bottom-color - * • border-left-color The default color is the currentColor of each of these values. - * If you provide one value, it sets the color for the element. Two values set the horizontal and vertical values, respectively. Providing three values sets the top, vertical, and bottom values, in that order. Four values set all for sides: top, right, bottom, and left, in that order. - */ - borderColor?: any; - - /** - * Specifies different corner clipping effects, such as scoop (inner curves), bevel (straight cuts) or notch (cut-off rectangles). Works along with border-radius to specify the size of each corner effect. - */ - borderCornerShape?: any; - - /** - * The property border-image-source is used to set the image to be used instead of the border style. If this is set to none the border-style is used instead. - */ - borderImageSource?: any; - - /** - * The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges. - */ - borderImageWidth?: any; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's left border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the left border — border-left-width, border-left-style and border-left-color. - */ - borderLeft?: any; - - /** - * The CSS border-left-color property sets the color of an element's left border. This page explains the border-left-color value, but often you will find it more convenient to fix the border's left color as part of a shorthand set, either border-left or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - borderLeftColor?: any; - - /** - * Sets the style of an element's left border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - */ - borderLeftStyle?: any; - - /** - * Sets the width of an element's left border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - */ - borderLeftWidth?: any; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's right border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the right border — border-right-width, border-right-style and border-right-color. - */ - borderRight?: any; - - /** - * Sets the color of an element's right border. This page explains the border-right-color value, but often you will find it more convenient to fix the border's right color as part of a shorthand set, either border-right or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - borderRightColor?: any; - - /** - * Sets the style of an element's right border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - */ - borderRightStyle?: any; - - /** - * Sets the width of an element's right border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - */ - borderRightWidth?: any; - - /** - * Specifies the distance between the borders of adjacent cells. - */ - borderSpacing?: any; - - /** - * Sets the style of an element's four borders. This property can have from one to four values. With only one value, the value will be applied to all four borders; otherwise, this works as a shorthand property for each of border-top-style, border-right-style, border-bottom-style, border-left-style, where each border style may be assigned a separate value. - */ - borderStyle?: any; - - /** - * Shorthand property that defines the border-width, border-style and border-color of an element's top border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the top border — border-top-width, border-top-style and border-top-color. - */ - borderTop?: any; - - /** - * Sets the color of an element's top border. This page explains the border-top-color value, but often you will find it more convenient to fix the border's top color as part of a shorthand set, either border-top or border-color. - * Colors can be defined several ways. For more information, see Usage. - */ - borderTopColor?: any; - - /** - * Sets the rounding of the top-left corner of the element. - */ - borderTopLeftRadius?: any; - - /** - * Sets the rounding of the top-right corner of the element. - */ - borderTopRightRadius?: any; - - /** - * Sets the style of an element's top border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. - */ - borderTopStyle?: any; - - /** - * Sets the width of an element's top border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - */ - borderTopWidth?: any; - - /** - * Sets the width of an element's four borders. This property can have from one to four values. This is a shorthand property for setting values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. - */ - borderWidth?: any; - - /** - * This property specifies how far an absolutely positioned box's bottom margin edge is offset above the bottom edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the bottom edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). - */ - bottom?: any; - - /** - * Obsolete. - */ - boxAlign?: any; - - /** - * Breaks a box into fragments creating new borders, padding and repeating backgrounds or lets it stay as a continuous box on a page break, column break, or, for inline elements, at a line break. - */ - boxDecorationBreak?: any; - - /** - * Deprecated - */ - boxDirection?: any; - - /** - * Do not use. This property has been replaced by the flex-wrap property. - * Gets or sets a value that specifies the direction to add successive rows or columns when the value of box-lines is set to multiple. - */ - boxLineProgression?: any; - - /** - * Do not use. This property has been replaced by the flex-wrap property. - * Gets or sets a value that specifies whether child elements wrap onto multiple lines or columns based on the space available in the object. - */ - boxLines?: any; - - /** - * Do not use. This property has been replaced by flex-order. - * Specifies the ordinal group that a child element of the object belongs to. This ordinal value identifies the display order (along the axis defined by the box-orient property) for the group. - */ - boxOrdinalGroup?: any; - - /** - * The CSS break-after property allows you to force a break on multi-column layouts. More specifically, it allows you to force a break after an element. It allows you to determine if a break should occur, and what type of break it should be. The break-after CSS property describes how the page, column or region break behaves after the generated box. If there is no generated box, the property is ignored. - */ - breakAfter?: any; - - /** - * Control page/column/region breaks that fall above a block of content - */ - breakBefore?: any; - - /** - * Control page/column/region breaks that fall within a block of content - */ - breakInside?: any; - - /** - * The clear CSS property specifies if an element can be positioned next to or must be positioned below the floating elements that precede it in the markup. - */ - clear?: any; - - /** - * Deprecated; see clip-path. - * Lets you specify the dimensions of an absolutely positioned element that should be visible, and the element is clipped into this shape, and displayed. - */ - clip?: any; - - /** - * Clipping crops an graphic, so that only a portion of the graphic is rendered, or filled. This clip-rule property, when used with the clip-path property, defines which clip rule, or algorithm, to use when filling the different parts of a graphics. - */ - clipRule?: any; - - /** - * The color property sets the color of an element's foreground content (usually text), accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a). - */ - color?: any; - - /** - * Specifies how to fill columns (balanced or sequential). - */ - columnFill?: any; - - /** - * The column-gap property controls the width of the gap between columns in multi-column elements. - */ - columnGap?: any; - - /** - * Sets the width, style, and color of the rule between columns. - */ - columnRule?: any; - - /** - * Specifies the color of the rule between columns. - */ - columnRuleColor?: any; - - /** - * Specifies the width of the rule between columns. - */ - columnRuleWidth?: any; - - /** - * The column-span CSS property makes it possible for an element to span across all columns when its value is set to all. An element that spans more than one column is called a spanning element. - */ - columnSpan?: any; - - /** - * Specifies the width of columns in multi-column elements. - */ - columnWidth?: any; - - /** - * This property is a shorthand property for setting column-width and/or column-count. - */ - columns?: any; - - /** - * The counter-increment property accepts one or more names of counters (identifiers), each one optionally followed by an integer which specifies the value by which the counter should be incremented (e.g. if the value is 2, the counter increases by 2 each time it is invoked). - */ - counterIncrement?: any; - - /** - * The counter-reset property contains a list of one or more names of counters, each one optionally followed by an integer (otherwise, the integer defaults to 0.) Each time the given element is invoked, the counters specified by the property are set to the given integer. - */ - counterReset?: any; - - /** - * The cue property specifies sound files (known as an "auditory icon") to be played by speech media agents before and after presenting an element's content; if only one file is specified, it is played both before and after. The volume at which the file(s) should be played, relative to the volume of the main element, may also be specified. The icon files may also be set separately with the cue-before and cue-after properties. - */ - cue?: any; - - /** - * The cue-after property specifies a sound file (known as an "auditory icon") to be played by speech media agents after presenting an element's content; the volume at which the file should be played may also be specified. The shorthand property cue sets cue sounds for both before and after the element is presented. - */ - cueAfter?: any; - - /** - * The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages. - */ - direction?: any; - - /** - * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. - */ - display?: any; - - /** - * The ‘fill’ property paints the interior of the given graphical element. The area to be painted consists of any areas inside the outline of the shape. To determine the inside of the shape, all subpaths are considered, and the interior is determined according to the rules associated with the current value of the ‘fill-rule’ property. The zero-width geometric outline of a shape is included in the area to be painted. - */ - fill?: any; - - /** - * The ‘fill-rule’ property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, the interpretation of "inside" is not so obvious. - * The ‘fill-rule’ property provides two options for how the inside of a shape is determined: - */ - fillRule?: any; - - /** - * Applies various image processing effects. This property is largely unsupported. See Compatibility section for more information. - */ - filter?: any; - - /** - * Obsolete, do not use. This property has been renamed to align-items. - * Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object. - */ - flexAlign?: any; - - /** - * The flex-basis CSS property describes the initial main size of the flex item before any free space is distributed according to the flex factors described in the flex property (flex-grow and flex-shrink). - */ - flexBasis?: any; - - /** - * The flex-direction CSS property describes how flex items are placed in the flex container, by setting the direction of the flex container's main axis. - */ - flexDirection?: any; - - /** - * The flex-flow CSS property defines the flex container's main and cross axis. It is a shorthand property for the flex-direction and flex-wrap properties. - */ - flexFlow?: any; - - /** - * Do not use. This property has been renamed to align-self - * Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object. - */ - flexItemAlign?: any; - - /** - * Do not use. This property has been renamed to align-content. - * Specifies how a flexbox's lines align within the flexbox when there is extra space along the axis that is perpendicular to the axis defined by the flex-direction property. - */ - flexLinePack?: any; - - /** - * Gets or sets a value that specifies the ordinal group that a flexbox element belongs to. This ordinal value identifies the display order for the group. - */ - flexOrder?: any; - - /** - * Elements which have the style float are floated horizontally. These elements can move as far to the left or right of the containing element. All elements after the floating element will flow around it, but elements before the floating element are not impacted. If several floating elements are placed after each other, they will float next to each other as long as there is room. - */ - float?: any; - - /** - * Flows content from a named flow (specified by a corresponding flow-into) through selected elements to form a dynamic chain of layout regions. - */ - flowFrom?: any; - - /** - * The font property is shorthand that allows you to do one of two things: you can either set up six of the most mature font properties in one line, or you can set one of a choice of keywords to adopt a system font setting. - */ - font?: any; - - /** - * The font-family property allows one or more font family names and/or generic family names to be specified for usage on the selected element(s)' text. The browser then goes through the list; for each character in the selection it applies the first font family that has an available glyph for that character. - */ - fontFamily?: any; - - /** - * The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. This property controls metric kerning - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet. - */ - fontKerning?: any; - - /** - * The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, so that the x-height is the same no matter what font is used. This preserves the readability of the text when fallback happens. - */ - fontSizeAdjust?: any; - - /** - * Allows you to expand or condense the widths for a normal, condensed, or expanded font face. - */ - fontStretch?: any; - - /** - * The font-style property allows normal, italic, or oblique faces to be selected. Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face. Oblique faces can be simulated by artificially sloping the glyphs of the regular face. - */ - fontStyle?: any; - - /** - * This value specifies whether the user agent is allowed to synthesize bold or oblique font faces when a font family lacks bold or italic faces. - */ - fontSynthesis?: any; - - /** - * The font-variant property enables you to select the small-caps font within a font family. - */ - fontVariant?: any; - - /** - * Fonts can provide alternate glyphs in addition to default glyph for a character. This property provides control over the selection of these alternate glyphs. - */ - fontVariantAlternates?: any; - - /** - * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration. - */ - gridArea?: any; - - /** - * Controls a grid item's placement in a grid area, particularly grid position and a grid span. Shorthand for setting grid-column-start and grid-column-end in a single declaration. - */ - gridColumn?: any; - - /** - * Controls a grid item's placement in a grid area as well as grid position and a grid span. The grid-column-end property (with grid-row-start, grid-row-end, and grid-column-start) determines a grid item's placement by specifying the grid lines of a grid item's grid area. - */ - gridColumnEnd?: any; - - /** - * Determines a grid item's placement by specifying the starting grid lines of a grid item's grid area . A grid item's placement in a grid area consists of a grid position and a grid span. See also ( grid-row-start, grid-row-end, and grid-column-end) - */ - gridColumnStart?: any; - - /** - * Gets or sets a value that indicates which row an element within a Grid should appear in. Shorthand for setting grid-row-start and grid-row-end in a single declaration. - */ - gridRow?: any; - - /** - * Determines a grid item’s placement by specifying the block-end. A grid item's placement in a grid area consists of a grid position and a grid span. The grid-row-end property (with grid-row-start, grid-column-start, and grid-column-end) determines a grid item's placement by specifying the grid lines of a grid item's grid area. - */ - gridRowEnd?: any; - - /** - * Specifies a row position based upon an integer location, string value, or desired row size. - * css/properties/grid-row is used as short-hand for grid-row-position and grid-row-position - */ - gridRowPosition?: any; - - gridRowSpan?: any; - - /** - * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand. - */ - gridTemplateAreas?: any; - - /** - * Specifies (with grid-template-rows) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. - */ - gridTemplateColumns?: any; - - /** - * Specifies (with grid-template-columns) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. - */ - gridTemplateRows?: any; - - /** - * Sets the height of an element. The content area of the element height does not include the padding, border, and margin of the element. - */ - height?: any; - - /** - * Specifies the minimum number of characters in a hyphenated word - */ - hyphenateLimitChars?: any; - - /** - * Indicates the maximum number of successive hyphenated lines in an element. The ‘no-limit’ value means that there is no limit. - */ - hyphenateLimitLines?: any; - - /** - * Specifies the maximum amount of trailing whitespace (before justification) that may be left in a line before hyphenation is triggered to pull part of a word from the next line back up into the current one. - */ - hyphenateLimitZone?: any; - - /** - * Specifies whether or not words in a sentence can be split by the use of a manual or automatic hyphenation mechanism. - */ - hyphens?: any; - - imeMode?: any; - - layoutGrid?: any; - - layoutGridChar?: any; - - layoutGridLine?: any; - - layoutGridMode?: any; - - layoutGridType?: any; - - /** - * Sets the left edge of an element - */ - left?: any; - - /** - * The letter-spacing CSS property specifies the spacing behavior between text characters. - */ - letterSpacing?: any; - - /** - * Deprecated. Gets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean. - */ - lineBreak?: any; - - /** - * Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration. - */ - listStyle?: any; - - /** - * This property sets the image that will be used as the list item marker. When the image is available, it will replace the marker set with the 'list-style-type' marker. That also means that if the image is not available, it will show the style specified by list-style-property - */ - listStyleImage?: any; - - /** - * Specifies if the list-item markers should appear inside or outside the content flow. - */ - listStylePosition?: any; - - /** - * Specifies the type of list-item marker in a list. - */ - listStyleType?: any; - - /** - * The margin property is shorthand to allow you to set all four margins of an element at once. Its equivalent longhand properties are margin-top, margin-right, margin-bottom and margin-left. Negative values are also allowed. - */ - margin?: any; - - /** - * margin-bottom sets the bottom margin of an element. - */ - marginBottom?: any; - - /** - * margin-left sets the left margin of an element. - */ - marginLeft?: any; - - /** - * margin-right sets the right margin of an element. - */ - marginRight?: any; - - /** - * margin-top sets the top margin of an element. - */ - marginTop?: any; - - /** - * The marquee-direction determines the initial direction in which the marquee content moves. - */ - marqueeDirection?: any; - - /** - * The 'marquee-style' property determines a marquee's scrolling behavior. - */ - marqueeStyle?: any; - - /** - * This property is shorthand for setting mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-composite and mask-size. Omitted values are set to their original properties' initial values. - */ - mask?: any; - - /** - * This property is shorthand for setting mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, and mask-border-repeat. Omitted values are set to their original properties' initial values. - */ - maskBorder?: any; - - /** - * This property specifies how the images for the sides and the middle part of the mask image are scaled and tiled. The first keyword applies to the horizontal sides, the second one applies to the vertical ones. If the second keyword is absent, it is assumed to be the same as the first, similar to the CSS border-image-repeat property. - */ - maskBorderRepeat?: any; - - /** - * This property specifies inward offsets from the top, right, bottom, and left edges of the mask image, dividing it into nine regions: four corners, four edges, and a middle. The middle image part is discarded and treated as fully transparent black unless the fill keyword is present. The four values set the top, right, bottom and left offsets in that order, similar to the CSS border-image-slice property. - */ - maskBorderSlice?: any; - - /** - * Specifies an image to be used as a mask. An image that is empty, fails to download, is non-existent, or cannot be displayed is ignored and does not mask the element. - */ - maskBorderSource?: any; - - /** - * This property sets the width of the mask box image, similar to the CSS border-image-width property. - */ - maskBorderWidth?: any; - - /** - * Determines the mask painting area, which defines the area that is affected by the mask. The painted content of an element may be restricted to this area. - */ - maskClip?: any; - - /** - * For elements rendered as a single box, specifies the mask positioning area. For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) specifies which boxes box-decoration-break operates on to determine the mask positioning area(s). - */ - maskOrigin?: any; - - /** - * This property must not be used. It is no longer included in any standard or standard track specification, nor is it implemented in any browser. It is only used when the text-align-last property is set to size. It controls allowed adjustments of font-size to fit line content. - */ - maxFontSize?: any; - - /** - * Sets the maximum height for an element. It prevents the height of the element to exceed the specified value. If min-height is specified and is greater than max-height, max-height is overridden. - */ - maxHeight?: any; - - /** - * Sets the maximum width for an element. It limits the width property to be larger than the value specified in max-width. - */ - maxWidth?: any; - - /** - * Sets the minimum height for an element. It prevents the height of the element to be smaller than the specified value. The value of min-height overrides both max-height and height. - */ - minHeight?: any; - - /** - * Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width. - */ - minWidth?: any; - - /** - * The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient. - * Outlines differ from borders in the following ways: • Outlines do not take up space, they are drawn above the content. - * • Outlines may be non-rectangular. They are rectangular in Gecko/Firefox. Internet Explorer attempts to place the smallest contiguous outline around all elements or shapes that are indicated to have an outline. Opera draws a non-rectangular shape around a construct. - */ - outline?: any; - - /** - * The outline-color property sets the color of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out. - */ - outlineColor?: any; - - /** - * The outline-offset property offsets the outline and draw it beyond the border edge. - */ - outlineOffset?: any; - - /** - * The overflow property controls how extra content exceeding the bounding box of an element is rendered. It can be used in conjunction with an element that has a fixed width and height, to eliminate text-induced page distortion. - */ - overflow?: any; - - /** - * Specifies the preferred scrolling methods for elements that overflow. - */ - overflowStyle?: any; - - /** - * The overflow-x property is a specific case of the generic overflow property. It controls how extra content exceeding the x-axis of the bounding box of an element is rendered. - */ - overflowX?: any; - - /** - * The padding optional CSS property sets the required padding space on one to four sides of an element. The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased. - * The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left). - */ - padding?: any; - - /** - * The padding-bottom CSS property of an element sets the padding space required on the bottom of an element. The padding area is the space between the content of the element and its border. Contrary to margin-bottom values, negative values of padding-bottom are invalid. - */ - paddingBottom?: any; - - /** - * The padding-left CSS property of an element sets the padding space required on the left side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-left values, negative values of padding-left are invalid. - */ - paddingLeft?: any; - - /** - * The padding-right CSS property of an element sets the padding space required on the right side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-right values, negative values of padding-right are invalid. - */ - paddingRight?: any; - - /** - * The padding-top CSS property of an element sets the padding space required on the top of an element. The padding area is the space between the content of the element and its border. Contrary to margin-top values, negative values of padding-top are invalid. - */ - paddingTop?: any; - - /** - * The page-break-after property is supported in all major browsers. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - pageBreakAfter?: any; - - /** - * The page-break-before property sets the page-breaking behavior before an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - pageBreakBefore?: any; - - /** - * Sets the page-breaking behavior inside an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. - */ - pageBreakInside?: any; - - /** - * The pause property determines how long a speech media agent should pause before and after presenting an element. It is a shorthand for the pause-before and pause-after properties. - */ - pause?: any; - - /** - * The pause-after property determines how long a speech media agent should pause after presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after. - */ - pauseAfter?: any; - - /** - * The pause-before property determines how long a speech media agent should pause before presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after. - */ - pauseBefore?: any; - - /** - * The perspective property defines how far an element is placed from the view on the z-axis, from the screen to the viewer. - * Perspective defines how an object is viewed. In graphic arts, perspective is the representation on a flat surface of what the viewer's eye would see in a 3D space. (See Wikipedia for more information about graphical perspective and for related illustrations.) - * The illusion of perspective on a flat surface, such as a computer screen, is created by projecting points on the flat surface as they would appear if the flat surface were a window through which the viewer was looking at the object. In discussion of virtual environments, this flat surface is called a projection plane. - */ - perspective?: any; - - /** - * The perspective-origin property establishes the origin for the perspective property. It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element. - * When used with perspective, perspective-origin changes the appearance of an object, as if a viewer were looking at it from a different origin. An object appears differently if a viewer is looking directly at it versus looking at it from below, above, or from the side. Thus, the perspective-origin is like a vanishing point. - * The default value of perspective-origin is 50% 50%. This displays an object as if the viewer's eye were positioned directly at the center of the screen, both top-to-bottom and left-to-right. A value of 0% 0% changes the object as if the viewer was looking toward the top left angle. A value of 100% 100% changes the appearance as if viewed toward the bottom right angle. - */ - perspectiveOrigin?: any; - - /** - * The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events. - */ - pointerEvents?: any; - - /** - * The position property controls the type of positioning used by an element within its parent elements. The effect of the position property depends on a lot of factors, for example the position property of parent elements. - */ - position?: any; - - /** - * Obsolete: unsupported. - * This property determines whether or not a full-width punctuation mark character should be trimmed if it appears at the beginning of a line, so that its "ink" lines up with the first glyph in the line above and below. - */ - punctuationTrim?: any; - - /** - * Sets the type of quotation marks for embedded quotations. - */ - quotes?: any; - - /** - * Controls whether the last region in a chain displays additional 'overset' content according its default overflow property, or if it displays a fragment of content as if it were flowing into a subsequent region. - */ - regionFragment?: any; - - /** - * The rest-after property determines how long a speech media agent should pause after presenting an element's main content, before presenting that element's exit cue sound. It may be replaced by the shorthand property rest, which sets rest time before and after. - */ - restAfter?: any; - - /** - * The rest-before property determines how long a speech media agent should pause after presenting an intro cue sound for an element, before presenting that element's main content. It may be replaced by the shorthand property rest, which sets rest time before and after. - */ - restBefore?: any; - - /** - * Specifies the position an element in relation to the right side of the containing element. - */ - right?: any; - - rubyAlign?: any; - - rubyPosition?: any; - - /** - * Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. - */ - shapeImageThreshold?: any; - - /** - * A future level of CSS Shapes will define a shape-inside property, which will define a shape to wrap content within the element. See Editor's Draft and CSSWG wiki page on next-level plans - */ - shapeInside?: any; - - /** - * Adds a margin to a shape-outside. In effect, defines a new shape that is the smallest contour around all the points that are the shape-margin distance outward perpendicular to each point on the underlying shape. For points where a perpendicular direction is not defined (e.g., a triangle corner), takes all points on a circle centered at the point and with a radius of the shape-margin distance. This property accepts only non-negative values. - */ - shapeMargin?: any; - - /** - * Declares a shape around which text should be wrapped, with possible modifications from the shape-margin property. The shape defined by shape-outside and shape-margin changes the geometry of a float element's float area. - */ - shapeOutside?: any; - - /** - * The speak property determines whether or not a speech synthesizer will read aloud the contents of an element. - */ - speak?: any; - - /** - * The speak-as property determines how the speech synthesizer interprets the content: words as whole words or as a sequence of letters, numbers as a numerical value or a sequence of digits, punctuation as pauses in speech or named punctuation characters. - */ - speakAs?: any; - - /** - * The tab-size CSS property is used to customise the width of a tab (U+0009) character. - */ - tabSize?: any; - - /** - * The 'table-layout' property controls the algorithm used to lay out the table cells, rows, and columns. - */ - tableLayout?: any; - - /** - * The text-align CSS property describes how inline content like text is aligned in its parent block element. text-align does not control the alignment of block elements itself, only their inline content. - */ - textAlign?: any; - - /** - * The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element. - */ - textAlignLast?: any; - - /** - * The text-decoration CSS property is used to set the text formatting to underline, overline, line-through or blink. - * underline and overline decorations are positioned under the text, line-through over it. - */ - textDecoration?: any; - - /** - * Sets the color of any text decoration, such as underlines, overlines, and strike throughs. - */ - textDecorationColor?: any; - - /** - * Sets what kind of line decorations are added to an element, such as underlines, overlines, etc. - */ - textDecorationLine?: any; - - textDecorationLineThrough?: any; - - textDecorationNone?: any; - - textDecorationOverline?: any; - - /** - * Specifies what parts of an element’s content are skipped over when applying any text decoration. - */ - textDecorationSkip?: any; - - /** - * This property specifies the style of the text decoration line drawn on the specified element. The intended meaning for the values are the same as those of the border-style-properties. - */ - textDecorationStyle?: any; - - textDecorationUnderline?: any; - - /** - * The text-emphasis property will apply special emphasis marks to the elements text. Slightly similar to the text-decoration property only that this property can have affect on the line-height. It also is noted that this is shorthand for text-emphasis-style and for text-emphasis-color. - */ - textEmphasis?: any; - - /** - * The text-emphasis-color property specifies the foreground color of the emphasis marks. - */ - textEmphasisColor?: any; - - /** - * The text-emphasis-style property applies special emphasis marks to an element's text. - */ - textEmphasisStyle?: any; - - /** - * This property helps determine an inline box's block-progression dimension, derived from the text-height and font-size properties for non-replaced elements, the height or the width for replaced elements, and the stacked block-progression dimension for inline-block elements. The block-progression dimension determines the position of the padding, border and margin for the element. - */ - textHeight?: any; - - /** - * Specifies the amount of space horizontally that should be left on the first line of the text of an element. This horizontal spacing is at the beginning of the first line and is in respect to the left edge of the containing block box. - */ - textIndent?: any; - - textJustifyTrim?: any; - - textKashidaSpace?: any; - - /** - * The text-line-through property is a shorthand property for text-line-through-style, text-line-through-color and text-line-through-mode. (Considered obsolete; use text-decoration instead.) - */ - textLineThrough?: any; - - /** - * Specifies the line colors for the line-through text decoration. - * (Considered obsolete; use text-decoration-color instead.) - */ - textLineThroughColor?: any; - - /** - * Sets the mode for the line-through text decoration, determining whether the text decoration affects the space characters or not. - * (Considered obsolete; use text-decoration-skip instead.) - */ - textLineThroughMode?: any; - - /** - * Specifies the line style for line-through text decoration. - * (Considered obsolete; use text-decoration-style instead.) - */ - textLineThroughStyle?: any; - - /** - * Specifies the line width for the line-through text decoration. - */ - textLineThroughWidth?: any; - - /** - * The text-overflow shorthand CSS property determines how overflowed content that is not displayed is signaled to the users. It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. It covers the two long-hand properties text-overflow-mode and text-overflow-ellipsis - */ - textOverflow?: any; - - /** - * The text-overline property is the shorthand for the text-overline-style, text-overline-width, text-overline-color, and text-overline-mode properties. - */ - textOverline?: any; - - /** - * Specifies the line color for the overline text decoration. - */ - textOverlineColor?: any; - - /** - * Sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not. - */ - textOverlineMode?: any; - - /** - * Specifies the line style for overline text decoration. - */ - textOverlineStyle?: any; - - /** - * Specifies the line width for the overline text decoration. - */ - textOverlineWidth?: any; - - /** - * The text-rendering CSS property provides information to the browser about how to optimize when rendering text. Options are: legibility, speed or geometric precision. - */ - textRendering?: any; - - /** - * Obsolete: unsupported. - */ - textScript?: any; - - /** - * The CSS text-shadow property applies one or more drop shadows to the text and of an element. Each shadow is specified as an offset from the text, along with optional color and blur radius values. - */ - textShadow?: any; - - /** - * This property transforms text for styling purposes. (It has no effect on the underlying content.) - */ - textTransform?: any; - - /** - * Unsupported. - * This property will add a underline position value to the element that has an underline defined. - */ - textUnderlinePosition?: any; - - /** - * After review this should be replaced by text-decoration should it not? - * This property will set the underline style for text with a line value for underline, overline, and line-through. - */ - textUnderlineStyle?: any; - - /** - * This property specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the top edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). - */ - top?: any; - - /** - * Determines whether touch input may trigger default behavior supplied by the user agent, such as panning or zooming. - */ - touchAction?: any; - - /** - * CSS transforms allow elements styled with CSS to be transformed in two-dimensional or three-dimensional space. Using this property, elements can be translated, rotated, scaled, and skewed. The value list may consist of 2D and/or 3D transform values. - */ - transform?: any; - - /** - * This property defines the origin of the transformation axes relative to the element to which the transformation is applied. - */ - transformOrigin?: any; - - /** - * This property allows you to define the relative position of the origin of the transformation grid along the z-axis. - */ - transformOriginZ?: any; - - /** - * This property specifies how nested elements are rendered in 3D space relative to their parent. - */ - transformStyle?: any; - - /** - * The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, and transition-delay. It allows to define the transition between two states of an element. - */ - transition?: any; - - /** - * Defines when the transition will start. A value of ‘0s’ means the transition will execute as soon as the property is changed. Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset. - */ - transitionDelay?: any; - - /** - * The 'transition-duration' property specifies the length of time a transition animation takes to complete. - */ - transitionDuration?: any; - - /** - * The 'transition-property' property specifies the name of the CSS property to which the transition is applied. - */ - transitionProperty?: any; - - /** - * Sets the pace of action within a transition - */ - transitionTimingFunction?: any; - - /** - * The unicode-bidi CSS property specifies the level of embedding with respect to the bidirectional algorithm. - */ - unicodeBidi?: any; - - /** - * unicode-range allows you to set a specific range of characters to be downloaded from a font (embedded using @font-face) and made available for use on the current page. - */ - unicodeRange?: any; - - /** - * This is for all the high level UX stuff. - */ - userFocus?: any; - - /** - * For inputing user content - */ - userInput?: any; - - /** - * The vertical-align property controls how inline elements or text are vertically aligned compared to the baseline. If this property is used on table-cells it controls the vertical alignment of content of the table cell. - */ - verticalAlign?: any; - - /** - * The visibility property specifies whether the boxes generated by an element are rendered. - */ - visibility?: any; - - /** - * The voice-balance property sets the apparent position (in stereo sound) of the synthesized voice for spoken media. - */ - voiceBalance?: any; - - /** - * The voice-duration property allows the author to explicitly set the amount of time it should take a speech synthesizer to read an element's content, for example to allow the speech to be synchronized with other media. With a value of auto (the default) the length of time it takes to read the content is determined by the content itself and the voice-rate property. - */ - voiceDuration?: any; - - /** - * The voice-family property sets the speaker's voice used by a speech media agent to read an element. The speaker may be specified as a named character (to match a voice option in the speech reading software) or as a generic description of the age and gender of the voice. Similar to the font-family property for visual media, a comma-separated list of fallback options may be given in case the speech reader does not recognize the character name or cannot synthesize the requested combination of generic properties. - */ - voiceFamily?: any; - - /** - * The voice-pitch property sets pitch or tone (high or low) for the synthesized speech when reading an element; the pitch may be specified absolutely or relative to the normal pitch for the voice-family used to read the text. - */ - voicePitch?: any; - - /** - * The voice-range property determines how much variation in pitch or tone will be created by the speech synthesize when reading an element. Emphasized text, grammatical structures and punctuation may all be rendered as changes in pitch, this property determines how strong or obvious those changes are; large ranges are associated with enthusiastic or emotional speech, while small ranges are associated with flat or mechanical speech. - */ - voiceRange?: any; - - /** - * The voice-rate property sets the speed at which the voice synthesized by a speech media agent will read content. - */ - voiceRate?: any; - - /** - * The voice-stress property sets the level of vocal emphasis to be used for synthesized speech reading the element. - */ - voiceStress?: any; - - /** - * The voice-volume property sets the volume for spoken content in speech media. It replaces the deprecated volume property. - */ - voiceVolume?: any; - - /** - * The white-space property controls whether and how white space inside the element is collapsed, and whether lines may wrap at unforced "soft wrap" opportunities. - */ - whiteSpace?: any; - - /** - * Obsolete: unsupported. - */ - whiteSpaceTreatment?: any; - - /** - * Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element. - */ - width?: any; - - /** - * The word-break property is often used when there is long generated content that is strung together without and spaces or hyphens to beak apart. A common case of this is when there is a long URL that does not have any hyphens. This case could potentially cause the breaking of the layout as it could extend past the parent element. - */ - wordBreak?: any; - - /** - * The word-spacing CSS property specifies the spacing behavior between "words". - */ - wordSpacing?: any; - - /** - * An alias of css/properties/overflow-wrap, word-wrap defines whether to break words when the content exceeds the boundaries of its container. - */ - wordWrap?: any; - - /** - * Specifies how exclusions affect inline content within block-level elements. Elements lay out their inline content in their content area but wrap around exclusion areas. - */ - wrapFlow?: any; - - /** - * Set the value that is used to offset the inner wrap shape from other shapes. Inline content that intersects a shape with this property will be pushed by this shape's margin. - */ - wrapMargin?: any; - - /** - * Obsolete and unsupported. Do not use. - * This CSS property controls the text when it reaches the end of the block in which it is enclosed. - */ - wrapOption?: any; - - /** - * writing-mode specifies if lines of text are laid out horizontally or vertically, and the direction which lines of text and blocks progress. - */ - writingMode?: any; - - - [propertyName: string]: any; - } - - interface HTMLAttributes extends DOMAttributes { - // React-specific Attributes - defaultChecked?: boolean; - defaultValue?: string | string[]; - - // Standard HTML Attributes - accept?: string; - acceptCharset?: string; - accessKey?: string; - action?: string; - allowFullScreen?: boolean; - allowTransparency?: boolean; - alt?: string; - async?: boolean; - autoComplete?: string; - autoFocus?: boolean; - autoPlay?: boolean; - capture?: boolean; - cellPadding?: number | string; - cellSpacing?: number | string; - charSet?: string; - challenge?: string; - checked?: boolean; - classID?: string; - className?: string; - cols?: number; - colSpan?: number; - content?: string; - contentEditable?: boolean; - contextMenu?: string; - controls?: boolean; - coords?: string; - crossOrigin?: string; - data?: string; - dateTime?: string; - default?: boolean; - defer?: boolean; - dir?: string; - disabled?: boolean; - download?: any; - draggable?: boolean; - encType?: string; - form?: string; - formAction?: string; - formEncType?: string; - formMethod?: string; - formNoValidate?: boolean; - formTarget?: string; - frameBorder?: number | string; - headers?: string; - height?: number | string; - hidden?: boolean; - high?: number; - href?: string; - hrefLang?: string; - htmlFor?: string; - httpEquiv?: string; - icon?: string; - id?: string; - inputMode?: string; - integrity?: string; - is?: string; - keyParams?: string; - keyType?: string; - kind?: string; - label?: string; - lang?: string; - list?: string; - loop?: boolean; - low?: number; - manifest?: string; - marginHeight?: number; - marginWidth?: number; - max?: number | string; - maxLength?: number; - media?: string; - mediaGroup?: string; - method?: string; - min?: number | string; - minLength?: number; - multiple?: boolean; - muted?: boolean; - name?: string; - noValidate?: boolean; - open?: boolean; - optimum?: number; - pattern?: string; - placeholder?: string; - poster?: string; - preload?: string; - radioGroup?: string; - readOnly?: boolean; - rel?: string; - required?: boolean; - role?: string; - rows?: number; - rowSpan?: number; - sandbox?: string; - scope?: string; - scoped?: boolean; - scrolling?: string; - seamless?: boolean; - selected?: boolean; - shape?: string; - size?: number; - sizes?: string; - span?: number; - spellCheck?: boolean; - src?: string; - srcDoc?: string; - srcLang?: string; - srcSet?: string; - start?: number; - step?: number | string; - style?: CSSProperties; - summary?: string; - tabIndex?: number; - target?: string; - title?: string; - type?: string; - useMap?: string; - value?: string | string[]; - width?: number | string; - wmode?: string; - wrap?: string; - - // RDFa Attributes - about?: string; - datatype?: string; - inlist?: any; - prefix?: string; - property?: string; - resource?: string; - typeof?: string; - vocab?: string; - - // Non-standard Attributes - autoCapitalize?: string; - autoCorrect?: string; - autoSave?: string; - color?: string; - itemProp?: string; - itemScope?: boolean; - itemType?: string; - itemID?: string; - itemRef?: string; - results?: number; - security?: string; - unselectable?: boolean; - } - - interface SVGAttributes extends HTMLAttributes { - clipPath?: string; - cx?: number | string; - cy?: number | string; - d?: string; - dx?: number | string; - dy?: number | string; - fill?: string; - fillOpacity?: number | string; - fontFamily?: string; - fontSize?: number | string; - fx?: number | string; - fy?: number | string; - gradientTransform?: string; - gradientUnits?: string; - markerEnd?: string; - markerMid?: string; - markerStart?: string; - offset?: number | string; - opacity?: number | string; - patternContentUnits?: string; - patternUnits?: string; - points?: string; - preserveAspectRatio?: string; - r?: number | string; - rx?: number | string; - ry?: number | string; - spreadMethod?: string; - stopColor?: string; - stopOpacity?: number | string; - stroke?: string; - strokeDasharray?: string; - strokeLinecap?: string; - strokeMiterlimit?: string; - strokeOpacity?: number | string; - strokeWidth?: number | string; - textAnchor?: string; - transform?: string; - version?: string; - viewBox?: string; - x1?: number | string; - x2?: number | string; - x?: number | string; - xlinkActuate?: string; - xlinkArcrole?: string; - xlinkHref?: string; - xlinkRole?: string; - xlinkShow?: string; - xlinkTitle?: string; - xlinkType?: string; - xmlBase?: string; - xmlLang?: string; - xmlSpace?: string; - y1?: number | string; - y2?: number | string; - y?: number | string; - } - - // - // React.DOM - // ---------------------------------------------------------------------- - - interface ReactDOM { - // HTML - a: HTMLFactory; - abbr: HTMLFactory; - address: HTMLFactory; - area: HTMLFactory; - article: HTMLFactory; - aside: HTMLFactory; - audio: HTMLFactory; - b: HTMLFactory; - base: HTMLFactory; - bdi: HTMLFactory; - bdo: HTMLFactory; - big: HTMLFactory; - blockquote: HTMLFactory; - body: HTMLFactory; - br: HTMLFactory; - button: HTMLFactory; - canvas: HTMLFactory; - caption: HTMLFactory; - cite: HTMLFactory; - code: HTMLFactory; - col: HTMLFactory; - colgroup: HTMLFactory; - data: HTMLFactory; - datalist: HTMLFactory; - dd: HTMLFactory; - del: HTMLFactory; - details: HTMLFactory; - dfn: HTMLFactory; - dialog: HTMLFactory; - div: HTMLFactory; - dl: HTMLFactory; - dt: HTMLFactory; - em: HTMLFactory; - embed: HTMLFactory; - fieldset: HTMLFactory; - figcaption: HTMLFactory; - figure: HTMLFactory; - footer: HTMLFactory; - form: HTMLFactory; - h1: HTMLFactory; - h2: HTMLFactory; - h3: HTMLFactory; - h4: HTMLFactory; - h5: HTMLFactory; - h6: HTMLFactory; - head: HTMLFactory; - header: HTMLFactory; - hgroup: HTMLFactory; - hr: HTMLFactory; - html: HTMLFactory; - i: HTMLFactory; - iframe: HTMLFactory; - img: HTMLFactory; - input: HTMLFactory; - ins: HTMLFactory; - kbd: HTMLFactory; - keygen: HTMLFactory; - label: HTMLFactory; - legend: HTMLFactory; - li: HTMLFactory; - link: HTMLFactory; - main: HTMLFactory; - map: HTMLFactory; - mark: HTMLFactory; - menu: HTMLFactory; - menuitem: HTMLFactory; - meta: HTMLFactory; - meter: HTMLFactory; - nav: HTMLFactory; - noscript: HTMLFactory; - object: HTMLFactory; - ol: HTMLFactory; - optgroup: HTMLFactory; - option: HTMLFactory; - output: HTMLFactory; - p: HTMLFactory; - param: HTMLFactory; - picture: HTMLFactory; - pre: HTMLFactory; - progress: HTMLFactory; - q: HTMLFactory; - rp: HTMLFactory; - rt: HTMLFactory; - ruby: HTMLFactory; - s: HTMLFactory; - samp: HTMLFactory; - script: HTMLFactory; - section: HTMLFactory; - select: HTMLFactory; - small: HTMLFactory; - source: HTMLFactory; - span: HTMLFactory; - strong: HTMLFactory; - style: HTMLFactory; - sub: HTMLFactory; - summary: HTMLFactory; - sup: HTMLFactory; - table: HTMLFactory; - tbody: HTMLFactory; - td: HTMLFactory; - textarea: HTMLFactory; - tfoot: HTMLFactory; - th: HTMLFactory; - thead: HTMLFactory; - time: HTMLFactory; - title: HTMLFactory; - tr: HTMLFactory; - track: HTMLFactory; - u: HTMLFactory; - ul: HTMLFactory; - "var": HTMLFactory; - video: HTMLFactory; - wbr: HTMLFactory; - - // SVG - svg: SVGFactory; - circle: SVGFactory; - defs: SVGFactory; - ellipse: SVGFactory; - g: SVGFactory; - image: SVGFactory; - line: SVGFactory; - linearGradient: SVGFactory; - mask: SVGFactory; - path: SVGFactory; - pattern: SVGFactory; - polygon: SVGFactory; - polyline: SVGFactory; - radialGradient: SVGFactory; - rect: SVGFactory; - stop: SVGFactory; - text: SVGFactory; - tspan: SVGFactory; - } - - // - // React.PropTypes - // ---------------------------------------------------------------------- - - interface Validator { - (object: T, key: string, componentName: string): Error; - } - - interface Requireable extends Validator { - isRequired: Validator; - } - - interface ValidationMap { - [key: string]: Validator; - } - - interface ReactPropTypes { - any: Requireable; - array: Requireable; - bool: Requireable; - func: Requireable; - number: Requireable; - object: Requireable; - string: Requireable; - node: Requireable; - element: Requireable; - instanceOf(expectedClass: {}): Requireable; - oneOf(types: any[]): Requireable; - oneOfType(types: Validator[]): Requireable; - arrayOf(type: Validator): Requireable; - objectOf(type: Validator): Requireable; - shape(type: ValidationMap): Requireable; - } - - // - // React.Children - // ---------------------------------------------------------------------- - - interface ReactChildren { - map(children: ReactNode, fn: (child: ReactChild, index: number) => T): T[]; - forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void; - count(children: ReactNode): number; - only(children: ReactNode): ReactElement; - toArray(children: ReactNode): ReactChild[]; - } - - // - // Browser Interfaces - // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts - // ---------------------------------------------------------------------- - - interface AbstractView { - styleMedia: StyleMedia; - document: Document; - } - - interface Touch { - identifier: number; - target: EventTarget; - screenX: number; - screenY: number; - clientX: number; - clientY: number; - pageX: number; - pageY: number; - } - - interface TouchList { - [index: number]: Touch; - length: number; - item(index: number): Touch; - identifiedTouch(identifier: number): Touch; - } -} - -declare module "react" { - export = __React; -} - -declare namespace JSX { - import React = __React; - - interface Element extends React.ReactElement { } - interface ElementClass extends React.Component { - render(): JSX.Element; - } - interface ElementAttributesProperty { props: {}; } - - interface IntrinsicAttributes { - key?: string | number; - } - - interface IntrinsicClassAttributes { - ref?: string | ((classInstance: T) => void); - } - - interface IntrinsicElements { - // HTML - a: React.HTMLProps; - abbr: React.HTMLProps; - address: React.HTMLProps; - area: React.HTMLProps; - article: React.HTMLProps; - aside: React.HTMLProps; - audio: React.HTMLProps; - b: React.HTMLProps; - base: React.HTMLProps; - bdi: React.HTMLProps; - bdo: React.HTMLProps; - big: React.HTMLProps; - blockquote: React.HTMLProps; - body: React.HTMLProps; - br: React.HTMLProps; - button: React.HTMLProps; - canvas: React.HTMLProps; - caption: React.HTMLProps; - cite: React.HTMLProps; - code: React.HTMLProps; - col: React.HTMLProps; - colgroup: React.HTMLProps; - data: React.HTMLProps; - datalist: React.HTMLProps; - dd: React.HTMLProps; - del: React.HTMLProps; - details: React.HTMLProps; - dfn: React.HTMLProps; - dialog: React.HTMLProps; - div: React.HTMLProps; - dl: React.HTMLProps; - dt: React.HTMLProps; - em: React.HTMLProps; - embed: React.HTMLProps; - fieldset: React.HTMLProps; - figcaption: React.HTMLProps; - figure: React.HTMLProps; - footer: React.HTMLProps; - form: React.HTMLProps; - h1: React.HTMLProps; - h2: React.HTMLProps; - h3: React.HTMLProps; - h4: React.HTMLProps; - h5: React.HTMLProps; - h6: React.HTMLProps; - head: React.HTMLProps; - header: React.HTMLProps; - hgroup: React.HTMLProps; - hr: React.HTMLProps; - html: React.HTMLProps; - i: React.HTMLProps; - iframe: React.HTMLProps; - img: React.HTMLProps; - input: React.HTMLProps; - ins: React.HTMLProps; - kbd: React.HTMLProps; - keygen: React.HTMLProps; - label: React.HTMLProps; - legend: React.HTMLProps; - li: React.HTMLProps; - link: React.HTMLProps; - main: React.HTMLProps; - map: React.HTMLProps; - mark: React.HTMLProps; - menu: React.HTMLProps; - menuitem: React.HTMLProps; - meta: React.HTMLProps; - meter: React.HTMLProps; - nav: React.HTMLProps; - noscript: React.HTMLProps; - object: React.HTMLProps; - ol: React.HTMLProps; - optgroup: React.HTMLProps; - option: React.HTMLProps; - output: React.HTMLProps; - p: React.HTMLProps; - param: React.HTMLProps; - picture: React.HTMLProps; - pre: React.HTMLProps; - progress: React.HTMLProps; - q: React.HTMLProps; - rp: React.HTMLProps; - rt: React.HTMLProps; - ruby: React.HTMLProps; - s: React.HTMLProps; - samp: React.HTMLProps; - script: React.HTMLProps; - section: React.HTMLProps; - select: React.HTMLProps; - small: React.HTMLProps; - source: React.HTMLProps; - span: React.HTMLProps; - strong: React.HTMLProps; - style: React.HTMLProps; - sub: React.HTMLProps; - summary: React.HTMLProps; - sup: React.HTMLProps; - table: React.HTMLProps; - tbody: React.HTMLProps; - td: React.HTMLProps; - textarea: React.HTMLProps; - tfoot: React.HTMLProps; - th: React.HTMLProps; - thead: React.HTMLProps; - time: React.HTMLProps; - title: React.HTMLProps; - tr: React.HTMLProps; - track: React.HTMLProps; - u: React.HTMLProps; - ul: React.HTMLProps; - "var": React.HTMLProps; - video: React.HTMLProps; - wbr: React.HTMLProps; - - // SVG - svg: React.SVGProps; - - circle: React.SVGProps; - clipPath: React.SVGProps; - defs: React.SVGProps; - ellipse: React.SVGProps; - g: React.SVGProps; - image: React.SVGProps; - line: React.SVGProps; - linearGradient: React.SVGProps; - mask: React.SVGProps; - path: React.SVGProps; - pattern: React.SVGProps; - polygon: React.SVGProps; - polyline: React.SVGProps; - radialGradient: React.SVGProps; - rect: React.SVGProps; - stop: React.SVGProps; - text: React.SVGProps; - tspan: React.SVGProps; - } -} diff --git a/templates/ReactSpa/typings/tsd.d.ts b/templates/ReactSpa/typings/tsd.d.ts deleted file mode 100644 index f54e1c6a..00000000 --- a/templates/ReactSpa/typings/tsd.d.ts +++ /dev/null @@ -1,6 +0,0 @@ - -/// -/// -/// -/// -/// diff --git a/templates/ReactSpa/typings/whatwg-fetch/whatwg-fetch.d.ts b/templates/ReactSpa/typings/whatwg-fetch/whatwg-fetch.d.ts deleted file mode 100644 index 64dd9048..00000000 --- a/templates/ReactSpa/typings/whatwg-fetch/whatwg-fetch.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -// Type definitions for fetch API -// Project: https://github.com/github/fetch -// Definitions by: Ryan Graham -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare class Request extends Body { - constructor(input: string|Request, init?:RequestInit); - method: string; - url: string; - headers: Headers; - context: string|RequestContext; - referrer: string; - mode: string|RequestMode; - credentials: string|RequestCredentials; - cache: string|RequestCache; -} - -interface RequestInit { - method?: string; - headers?: HeaderInit|{ [index: string]: string }; - body?: BodyInit; - mode?: string|RequestMode; - credentials?: string|RequestCredentials; - cache?: string|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; - json(): Promise; - text(): Promise; -} -declare class Response extends Body { - constructor(body?: BodyInit, init?: ResponseInit); - error(): Response; - redirect(url: string, status: number): Response; - type: string|ResponseType; - url: string; - status: number; - ok: boolean; - statusText: string; - headers: Headers; - clone(): Response; -} - -declare enum ResponseType { "basic", "cors", "default", "error", "opaque" } - -interface 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|Request, init?: RequestInit): Promise; -} - -declare var fetch: typeof window.fetch; diff --git a/templates/ReactSpa/web.config b/templates/ReactSpa/web.config deleted file mode 100644 index a8d66727..00000000 --- a/templates/ReactSpa/web.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/templates/ReactSpa/webpack.config.dev.js b/templates/ReactSpa/webpack.config.dev.js deleted file mode 100644 index fd41ce68..00000000 --- a/templates/ReactSpa/webpack.config.dev.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - devtool: 'inline-source-map', - module: { - loaders: [ - { test: /\.css/, loader: 'style!css' } - ] - } -}; diff --git a/templates/ReactSpa/webpack.config.js b/templates/ReactSpa/webpack.config.js deleted file mode 100644 index bb02f421..00000000 --- a/templates/ReactSpa/webpack.config.js +++ /dev/null @@ -1,32 +0,0 @@ -var path = require('path'); -var webpack = require('webpack'); -var merge = require('extendify')({ isDeep: true, arrays: 'concat' }); -var devConfig = require('./webpack.config.dev'); -var prodConfig = require('./webpack.config.prod'); -var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; - -module.exports = merge({ - resolve: { - extensions: [ '', '.js', '.jsx', '.ts', '.tsx' ] - }, - module: { - loaders: [ - { test: /\.ts(x?)$/, include: /ClientApp/, loader: 'babel-loader' }, - { test: /\.ts(x?)$/, include: /ClientApp/, loader: 'ts-loader' } - ] - }, - entry: { - main: ['./ClientApp/boot.tsx'], - }, - output: { - path: path.join(__dirname, 'wwwroot', 'dist'), - filename: '[name].js', - publicPath: '/dist/' - }, - plugins: [ - new webpack.DllReferencePlugin({ - context: __dirname, - manifest: require('./wwwroot/dist/vendor-manifest.json') - }) - ] -}, isDevelopment ? devConfig : prodConfig); diff --git a/templates/ReactSpa/webpack.config.prod.js b/templates/ReactSpa/webpack.config.prod.js deleted file mode 100644 index 068da382..00000000 --- a/templates/ReactSpa/webpack.config.prod.js +++ /dev/null @@ -1,16 +0,0 @@ -var webpack = require('webpack'); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); -var extractCSS = new ExtractTextPlugin('site.css'); - -module.exports = { - module: { - loaders: [ - { test: /\.css/, loader: extractCSS.extract(['css']) }, - ] - }, - plugins: [ - extractCSS, - new webpack.optimize.OccurenceOrderPlugin(), - new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }) - ] -}; diff --git a/templates/ReactSpa/webpack.config.vendor.js b/templates/ReactSpa/webpack.config.vendor.js deleted file mode 100644 index 814f23dd..00000000 --- a/templates/ReactSpa/webpack.config.vendor.js +++ /dev/null @@ -1,36 +0,0 @@ -var path = require('path'); -var webpack = require('webpack'); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); -var extractCSS = new ExtractTextPlugin('vendor.css'); -var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; - -module.exports = { - resolve: { - extensions: [ '', '.js' ] - }, - module: { - loaders: [ - { test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }, - { test: /\.css/, loader: extractCSS.extract(['css']) } - ] - }, - entry: { - vendor: ['bootstrap', 'bootstrap/dist/css/bootstrap.css', 'react', 'react-dom', 'react-router', 'style-loader', 'jquery'], - }, - output: { - path: path.join(__dirname, 'wwwroot', 'dist'), - filename: '[name].js', - library: '[name]_[hash]', - }, - plugins: [ - extractCSS, - new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable) - new webpack.optimize.OccurenceOrderPlugin(), - new webpack.DllPlugin({ - path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'), - name: '[name]_[hash]' - }) - ].concat(isDevelopment ? [] : [ - new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }) - ]) -}; diff --git a/templates/ReactSpa/wwwroot/favicon.ico b/templates/ReactSpa/wwwroot/favicon.ico deleted file mode 100755 index a3a79998..00000000 Binary files a/templates/ReactSpa/wwwroot/favicon.ico and /dev/null differ diff --git a/templates/ReactSpa/wwwroot/web.config b/templates/ReactSpa/wwwroot/web.config deleted file mode 100644 index e70a7778..00000000 --- a/templates/ReactSpa/wwwroot/web.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/templates/WebApplicationBasic/ClientApp/App.ts b/templates/WebApplicationBasic/ClientApp/App.ts deleted file mode 100644 index 4cde26cb..00000000 --- a/templates/WebApplicationBasic/ClientApp/App.ts +++ /dev/null @@ -1,5 +0,0 @@ -import 'bootstrap'; -import './css/site.css'; - -// Replace with your TypeScript code -console.log('Hello, world!'); diff --git a/templates/WebApplicationBasic/ClientApp/css/site.css b/templates/WebApplicationBasic/ClientApp/css/site.css deleted file mode 100755 index af0456db..00000000 --- a/templates/WebApplicationBasic/ClientApp/css/site.css +++ /dev/null @@ -1,24 +0,0 @@ -body { - padding-top: 50px; - padding-bottom: 20px; -} - -/* Wrapping element */ -/* Set some basic padding to keep content from hitting the edges */ -.body-content { - padding-left: 15px; - padding-right: 15px; -} - -/* Set widths on the form inputs since otherwise they're 100% wide */ -input, -select, -textarea { - max-width: 280px; -} - -/* Carousel */ -.carousel-caption p { - font-size: 20px; - line-height: 1.4; -} diff --git a/templates/WebApplicationBasic/Controllers/HomeController.cs b/templates/WebApplicationBasic/Controllers/HomeController.cs deleted file mode 100755 index 03b3a060..00000000 --- a/templates/WebApplicationBasic/Controllers/HomeController.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace WebApplicationBasic.Controllers -{ - public class HomeController : Controller - { - public IActionResult Index() - { - return View(); - } - - public IActionResult About() - { - ViewData["Message"] = "Your application description page."; - - return View(); - } - - public IActionResult Contact() - { - ViewData["Message"] = "Your contact page."; - - return View(); - } - - public IActionResult Error() - { - return View(); - } - } -} diff --git a/templates/WebApplicationBasic/Dockerfile b/templates/WebApplicationBasic/Dockerfile deleted file mode 100644 index 63d7c456..00000000 --- a/templates/WebApplicationBasic/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM microsoft/aspnet:1.0.0-rc1-update1 - -RUN printf "deb http://ftp.us.debian.org/debian jessie main\n" >> /etc/apt/sources.list -RUN apt-get -qq update && apt-get install -qqy sqlite3 libsqlite3-dev && rm -rf /var/lib/apt/lists/* - -COPY . /app -WORKDIR /app -RUN ["dnu", "restore"] - -EXPOSE 5000/tcp -ENTRYPOINT ["dnx", "-p", "project.json", "web"] diff --git a/templates/WebApplicationBasic/README.md b/templates/WebApplicationBasic/README.md deleted file mode 100644 index 4e494c9a..00000000 --- a/templates/WebApplicationBasic/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Welcome to ASP.NET 5 - -We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. - -You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) - -## This application consists of: - -* Sample pages using ASP.NET MVC 6 -* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side libraries -* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) - -## How to - -* [Add a Controller and View](http://go.microsoft.com/fwlink/?LinkID=398600) -* [Add an appsetting in config and access it in app.](http://go.microsoft.com/fwlink/?LinkID=699562) -* [Manage User Secrets using Secret Manager.](http://go.microsoft.com/fwlink/?LinkId=699315) -* [Use logging to log a message.](http://go.microsoft.com/fwlink/?LinkId=699316) -* [Add packages using NuGet.](http://go.microsoft.com/fwlink/?LinkId=699317) -* [Add client packages using Bower.](http://go.microsoft.com/fwlink/?LinkId=699318) -* [Target development, staging or production environment.](http://go.microsoft.com/fwlink/?LinkId=699319) - -## Overview - -* [Conceptual overview of what is ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518008) -* [Fundamentals of ASP.NET 5 such as Startup and middleware.](http://go.microsoft.com/fwlink/?LinkId=699320) -* [Working with Data](http://go.microsoft.com/fwlink/?LinkId=398602) -* [Security](http://go.microsoft.com/fwlink/?LinkId=398603) -* [Client side development](http://go.microsoft.com/fwlink/?LinkID=699321) -* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=699322) -* [Read more on the documentation site](http://go.microsoft.com/fwlink/?LinkID=699323) - -## Run & Deploy - -* [Run your app](http://go.microsoft.com/fwlink/?LinkID=517851) -* [Run your app on .NET Core](http://go.microsoft.com/fwlink/?LinkID=517852) -* [Run commands in your project.json](http://go.microsoft.com/fwlink/?LinkID=517853) -* [Publish to Microsoft Azure Web Apps](http://go.microsoft.com/fwlink/?LinkID=398609) - -We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/templates/WebApplicationBasic/Startup.cs b/templates/WebApplicationBasic/Startup.cs deleted file mode 100755 index 4ddc86c9..00000000 --- a/templates/WebApplicationBasic/Startup.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace WebApplicationBasic -{ - public class Startup - { - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc(); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory, IHostingEnvironment env) - { - app.UseDeveloperExceptionPage(); - - app.UseStaticFiles(); - loggerFactory.AddConsole(); - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - }); - } - - public static void Main(string[] args) - { - var host = new WebHostBuilder() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseIISIntegration() - .UseKestrel() - .UseStartup() - .Build(); - - host.Run(); - } - } -} diff --git a/templates/WebApplicationBasic/Views/Home/About.cshtml b/templates/WebApplicationBasic/Views/Home/About.cshtml deleted file mode 100755 index b653a26f..00000000 --- a/templates/WebApplicationBasic/Views/Home/About.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@{ - ViewData["Title"] = "About"; -} -

    @ViewData["Title"].

    -

    @ViewData["Message"]

    - -

    Use this area to provide additional information.

    diff --git a/templates/WebApplicationBasic/Views/Home/Contact.cshtml b/templates/WebApplicationBasic/Views/Home/Contact.cshtml deleted file mode 100755 index f953aa63..00000000 --- a/templates/WebApplicationBasic/Views/Home/Contact.cshtml +++ /dev/null @@ -1,17 +0,0 @@ -@{ - ViewData["Title"] = "Contact"; -} -

    @ViewData["Title"].

    -

    @ViewData["Message"]

    - -
    - One Microsoft Way
    - Redmond, WA 98052-6399
    - P: - 425.555.0100 -
    - -
    - Support: Support@example.com
    - Marketing: Marketing@example.com -
    diff --git a/templates/WebApplicationBasic/Views/Home/Index.cshtml b/templates/WebApplicationBasic/Views/Home/Index.cshtml deleted file mode 100755 index 6fef9aef..00000000 --- a/templates/WebApplicationBasic/Views/Home/Index.cshtml +++ /dev/null @@ -1,114 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - - - - - -@section scripts { - -} diff --git a/templates/WebApplicationBasic/Views/Shared/Error.cshtml b/templates/WebApplicationBasic/Views/Shared/Error.cshtml deleted file mode 100755 index 473b35d6..00000000 --- a/templates/WebApplicationBasic/Views/Shared/Error.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ViewData["Title"] = "Error"; -} - -

    Error.

    -

    An error occurred while processing your request.

    diff --git a/templates/WebApplicationBasic/Views/Shared/_Layout.cshtml b/templates/WebApplicationBasic/Views/Shared/_Layout.cshtml deleted file mode 100755 index 787de23e..00000000 --- a/templates/WebApplicationBasic/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - @ViewData["Title"] - WebApplicationBasic - - - - - - -
    - @RenderBody() -
    -
    -

    © 2016 - WebApplicationBasic

    -
    -
    - - - @RenderSection("scripts", required: false) - - diff --git a/templates/WebApplicationBasic/Views/_ViewImports.cshtml b/templates/WebApplicationBasic/Views/_ViewImports.cshtml deleted file mode 100755 index 6b9e366d..00000000 --- a/templates/WebApplicationBasic/Views/_ViewImports.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@using WebApplicationBasic -@addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" diff --git a/templates/WebApplicationBasic/Views/_ViewStart.cshtml b/templates/WebApplicationBasic/Views/_ViewStart.cshtml deleted file mode 100755 index 820a2f6e..00000000 --- a/templates/WebApplicationBasic/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/templates/WebApplicationBasic/WebApplicationBasic.xproj b/templates/WebApplicationBasic/WebApplicationBasic.xproj deleted file mode 100644 index b0c23a00..00000000 --- a/templates/WebApplicationBasic/WebApplicationBasic.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - true - - - - cb4398d6-b7f1-449a-ae02-828769679232 - WebApplicationBasic - ..\..\..\JavaScriptServices.sln\artifacts\obj\$(MSBuildProjectName) - .\bin\ - - - 2.0 - 2018 - - - \ No newline at end of file diff --git a/templates/WebApplicationBasic/appsettings.json b/templates/WebApplicationBasic/appsettings.json deleted file mode 100755 index e5472e56..00000000 --- a/templates/WebApplicationBasic/appsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Verbose", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/templates/WebApplicationBasic/package.json b/templates/WebApplicationBasic/package.json deleted file mode 100644 index b899475a..00000000 --- a/templates/WebApplicationBasic/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "WebApplicationBasic", - "version": "0.0.0", - "devDependencies": { - "bootstrap": "^3.3.6", - "css-loader": "^0.23.1", - "extendify": "^1.0.0", - "extract-text-webpack-plugin": "^1.0.1", - "file-loader": "^0.8.5", - "jquery": "^2.2.1", - "style-loader": "^0.13.0", - "ts-loader": "^0.8.1", - "typescript": "^1.8.2", - "url-loader": "^0.5.7", - "webpack": "^1.12.14" - } -} diff --git a/templates/WebApplicationBasic/project.json b/templates/WebApplicationBasic/project.json deleted file mode 100755 index a28b4b39..00000000 --- a/templates/WebApplicationBasic/project.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.0", - "type": "platform" - }, - "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0", - "Microsoft.AspNetCore.Diagnostics": "1.0.0", - "Microsoft.AspNetCore.Mvc": "1.0.0", - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", - "Microsoft.AspNetCore.StaticFiles": "1.0.0", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Logging": "1.0.0", - "Microsoft.Extensions.Logging.Console": "1.0.0", - "Microsoft.Extensions.Logging.Debug": "1.0.0", - "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { - "version": "1.0.0-preview2-final", - "type": "build" - }, - "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": { - "version": "1.0.0-preview2-final", - "type": "build" - } - }, - - "tools": { - "Microsoft.AspNetCore.Razor.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.AspNetCore.Server.IISIntegration.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.EntityFrameworkCore.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - }, - "Microsoft.Extensions.SecretManager.Tools": { - "version": "1.0.0-preview2-final", - "imports": "portable-net45+win8+dnxcore50" - }, - "Microsoft.VisualStudio.Web.CodeGeneration.Tools": { - "version": "1.0.0-preview2-final", - "imports": [ - "portable-net45+win8+dnxcore50", - "portable-net45+win8" - ] - } - }, - - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "dotnet5.6", - "dnxcore50", - "portable-net45+win8" - ] - } - }, - - "buildOptions": { - "debugType": "portable", - "emitEntryPoint": true, - "preserveCompilationContext": true - }, - - "runtimeOptions": { - "configProperties": { - "System.GC.Server": true - } - }, - - "publishOptions": { - "include": [ - "appsettings.json", - "Views", - "web.config", - "wwwroot" - ] - }, - - "scripts": { - "prepublish": [ - "npm install", - "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js", - "node node_modules/webpack/bin/webpack.js" - ], - "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] - }, - - "tooling": { - "defaultNamespace": "WebApplicationBasic" - } -} diff --git a/templates/WebApplicationBasic/template_gitignore b/templates/WebApplicationBasic/template_gitignore deleted file mode 100644 index d410b8bb..00000000 --- a/templates/WebApplicationBasic/template_gitignore +++ /dev/null @@ -1,237 +0,0 @@ -/Properties/launchSettings.json - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -bin/ -Bin/ -obj/ -Obj/ - -# Visual Studio 2015 cache/options directory -.vs/ -/wwwroot/dist/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Microsoft Azure ApplicationInsights config file -ApplicationInsights.config - -# Windows Store app package directory -AppPackages/ -BundleArtifacts/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe - -# FAKE - F# Make -.fake/ diff --git a/templates/WebApplicationBasic/tsconfig.json b/templates/WebApplicationBasic/tsconfig.json deleted file mode 100644 index 61872e16..00000000 --- a/templates/WebApplicationBasic/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "node", - "target": "es5", - "sourceMap": true, - "skipDefaultLibCheck": true - }, - "exclude": [ - "node_modules" - ] -} diff --git a/templates/WebApplicationBasic/web.config b/templates/WebApplicationBasic/web.config deleted file mode 100644 index a8d66727..00000000 --- a/templates/WebApplicationBasic/web.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/templates/WebApplicationBasic/webpack.config.dev.js b/templates/WebApplicationBasic/webpack.config.dev.js deleted file mode 100644 index 719de1fb..00000000 --- a/templates/WebApplicationBasic/webpack.config.dev.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - devtool: 'inline-source-map' -}; diff --git a/templates/WebApplicationBasic/webpack.config.js b/templates/WebApplicationBasic/webpack.config.js deleted file mode 100644 index 030fe54b..00000000 --- a/templates/WebApplicationBasic/webpack.config.js +++ /dev/null @@ -1,35 +0,0 @@ -var path = require('path'); -var webpack = require('webpack'); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); -var merge = require('extendify')({ isDeep: true, arrays: 'concat' }); -var devConfig = require('./webpack.config.dev'); -var prodConfig = require('./webpack.config.prod'); -var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; -var extractCSS = new ExtractTextPlugin('site.css'); - -module.exports = merge({ - resolve: { - extensions: [ '', '.js', '.jsx', '.ts', '.tsx' ] - }, - module: { - loaders: [ - { test: /\.ts(x?)$/, include: /ClientApp/, loader: 'ts-loader' }, - { test: /\.css/, loader: extractCSS.extract(['css']) } - ] - }, - entry: { - main: ['./ClientApp/App.ts'] - }, - output: { - path: path.join(__dirname, 'wwwroot', 'dist'), - filename: '[name].js', - publicPath: '/dist/' - }, - plugins: [ - extractCSS, - new webpack.DllReferencePlugin({ - context: __dirname, - manifest: require('./wwwroot/dist/vendor-manifest.json') - }) - ] -}, isDevelopment ? devConfig : prodConfig); diff --git a/templates/WebApplicationBasic/webpack.config.prod.js b/templates/WebApplicationBasic/webpack.config.prod.js deleted file mode 100644 index 775f115f..00000000 --- a/templates/WebApplicationBasic/webpack.config.prod.js +++ /dev/null @@ -1,8 +0,0 @@ -var webpack = require('webpack'); - -module.exports = { - plugins: [ - new webpack.optimize.OccurenceOrderPlugin(), - new webpack.optimize.UglifyJsPlugin({ minimize: true }) - ] -}; diff --git a/templates/WebApplicationBasic/webpack.config.vendor.js b/templates/WebApplicationBasic/webpack.config.vendor.js deleted file mode 100644 index 19ad77c5..00000000 --- a/templates/WebApplicationBasic/webpack.config.vendor.js +++ /dev/null @@ -1,36 +0,0 @@ -var path = require('path'); -var webpack = require('webpack'); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); -var extractCSS = new ExtractTextPlugin('vendor.css'); -var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development'; - -module.exports = { - resolve: { - extensions: [ '', '.js' ] - }, - module: { - loaders: [ - { test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000' }, - { test: /\.css/, loader: extractCSS.extract(['css']) } - ] - }, - entry: { - vendor: ['bootstrap', 'bootstrap/dist/css/bootstrap.css', 'style-loader', 'jquery'] - }, - output: { - path: path.join(__dirname, 'wwwroot', 'dist'), - filename: '[name].js', - library: '[name]_[hash]', - }, - plugins: [ - extractCSS, - new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), // Maps these identifiers to the jQuery package (because Bootstrap expects it to be a global variable) - new webpack.optimize.OccurenceOrderPlugin(), - new webpack.DllPlugin({ - path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'), - name: '[name]_[hash]' - }) - ].concat(isDevelopment ? [] : [ - new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }) - ]) -}; diff --git a/templates/WebApplicationBasic/wwwroot/favicon.ico b/templates/WebApplicationBasic/wwwroot/favicon.ico deleted file mode 100755 index a3a79998..00000000 Binary files a/templates/WebApplicationBasic/wwwroot/favicon.ico and /dev/null differ diff --git a/templates/WebApplicationBasic/wwwroot/images/ASP-NET-Banners-01.png b/templates/WebApplicationBasic/wwwroot/images/ASP-NET-Banners-01.png deleted file mode 100755 index ad3c267c..00000000 Binary files a/templates/WebApplicationBasic/wwwroot/images/ASP-NET-Banners-01.png and /dev/null differ diff --git a/templates/WebApplicationBasic/wwwroot/images/ASP-NET-Banners-02.png b/templates/WebApplicationBasic/wwwroot/images/ASP-NET-Banners-02.png deleted file mode 100755 index 16c37fc5..00000000 Binary files a/templates/WebApplicationBasic/wwwroot/images/ASP-NET-Banners-02.png and /dev/null differ diff --git a/templates/WebApplicationBasic/wwwroot/images/Banner-01-Azure.png b/templates/WebApplicationBasic/wwwroot/images/Banner-01-Azure.png deleted file mode 100755 index 59fb923e..00000000 Binary files a/templates/WebApplicationBasic/wwwroot/images/Banner-01-Azure.png and /dev/null differ diff --git a/templates/WebApplicationBasic/wwwroot/images/Banner-02-VS.png b/templates/WebApplicationBasic/wwwroot/images/Banner-02-VS.png deleted file mode 100755 index c9f46113..00000000 Binary files a/templates/WebApplicationBasic/wwwroot/images/Banner-02-VS.png and /dev/null differ diff --git a/templates/WebApplicationBasic/wwwroot/web.config b/templates/WebApplicationBasic/wwwroot/web.config deleted file mode 100644 index e70a7778..00000000 --- a/templates/WebApplicationBasic/wwwroot/web.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/templates/WhereHaveTheTemplatesGone.md b/templates/WhereHaveTheTemplatesGone.md new file mode 100644 index 00000000..939f5cfe --- /dev/null +++ b/templates/WhereHaveTheTemplatesGone.md @@ -0,0 +1,11 @@ +# Where have all the SPA templates gone? + +They are now in the [ASP.NET templating](https://github.com/aspnet/templating) repo. + +This is so that all the ASP.NET templates (both SPA and non-SPA) can be built, tested, and packaged from a single location and always included automatically in future SDK builds. + +### What about issues and pull requests? + +If you have issues or comments about the SPA templates, please continue to post them [here in this repo](https://github.com/aspnet/JavaScriptServices/issues), because then you will reach a more relevant group of contributors than if you posted to `aspnet/templating`. + +If you want to submit a pull request on the SPA templates, then of course you will neeed to submit that to the `aspnet/templating` repo, because that's where the code is now. But before doing so it's always a good idea to [post an issue on this repo](https://github.com/aspnet/JavaScriptServices/issues) describing what you want to do, so we can discuss whether or not such a PR would be accepted. diff --git a/templates/yeoman/.gitignore b/templates/yeoman/.gitignore deleted file mode 100644 index 33254eb3..00000000 --- a/templates/yeoman/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/node_modules/ -/built/ -/generator-aspnetcore-spa/ diff --git a/templates/yeoman/README.md b/templates/yeoman/README.md deleted file mode 100644 index 74d42abf..00000000 --- a/templates/yeoman/README.md +++ /dev/null @@ -1,5 +0,0 @@ -To generator the Yeoman generator, execute: - - npm run build - -Output will appear in the `generator-aspnetcore-spa` directory. diff --git a/templates/yeoman/package.json b/templates/yeoman/package.json deleted file mode 100644 index e97d33f6..00000000 --- a/templates/yeoman/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "generator-aspnetcore-spa-generator", - "version": "1.0.0", - "description": "Creates the Yeoman generator for ASP.NET Core SPA templates", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "build": "tsc && node ./tmp/build/build.js" - }, - "author": "Microsoft", - "license": "Apache-2.0", - "dependencies": { - "diff": "^2.2.2", - "gitignore-parser": "0.0.2", - "glob": "^7.0.3", - "lodash": "^4.11.1", - "mkdirp": "^0.5.1", - "rimraf": "^2.5.2" - }, - "devDependencies": { - "typescript": "^1.8.10" - } -} diff --git a/templates/yeoman/src/build/build.ts b/templates/yeoman/src/build/build.ts deleted file mode 100644 index ce071005..00000000 --- a/templates/yeoman/src/build/build.ts +++ /dev/null @@ -1,99 +0,0 @@ -import * as glob from 'glob'; -import * as gitignore from 'gitignore-parser'; -import * as fs from 'fs'; -import * as path from 'path'; -import * as _ from 'lodash'; -import * as mkdirp from 'mkdirp'; -import * as rimraf from 'rimraf'; - -const textFileExtensions = ['.gitignore', 'template_gitignore', '.config', '.cs', '.cshtml', 'Dockerfile', '.html', '.js', '.json', '.jsx', '.md', '.ts', '.tsx', '.xproj']; - -const templates = { - 'angular-2': '../../templates/Angular2Spa/', - 'knockout': '../../templates/KnockoutSpa/', - 'react-redux': '../../templates/ReactReduxSpa/', - 'react': '../../templates/ReactSpa/' -}; - -const contentReplacements: { from: RegExp, to: string }[] = [ - { from: /\bWebApplicationBasic\b/g, to: '<%= namePascalCase %>' }, - { from: /[0-9a-f\-]{36}<\/ProjectGuid>/g, to: '<%= projectGuid %>' }, - { from: /.*?<\/RootNamespace>/g, to: '<%= namePascalCase %>'}, - { from: /\s*/g, to: '' }, - { from: /\s*/g, to: '' }, -]; - -const filenameReplacements: { from: RegExp, to: string }[] = [ - { from: /.*\.xproj$/, to: 'tokenreplace-namePascalCase.xproj' } -]; - -function isTextFile(filename: string): boolean { - return textFileExtensions.indexOf(path.extname(filename).toLowerCase()) >= 0; -} - -function writeFileEnsuringDirExists(root: string, filename: string, contents: string | Buffer) { - let fullPath = path.join(root, filename); - mkdirp.sync(path.dirname(fullPath)); - fs.writeFileSync(fullPath, contents); -} - -function listFilesExcludingGitignored(root: string): string[] { - // Note that the gitignore files, prior to be written by the generator, are called 'template_gitignore' - // instead of '.gitignore'. This is a workaround for Yeoman doing strange stuff with .gitignore files - // (it renames them to .npmignore, which is not helpful). - let gitIgnorePath = path.join(root, 'template_gitignore'); - let gitignoreEvaluator = fs.existsSync(gitIgnorePath) - ? gitignore.compile(fs.readFileSync(gitIgnorePath, 'utf8')) - : { accepts: () => true }; - return glob.sync('**/*', { cwd: root, dot: true, nodir: true }) - .filter(fn => gitignoreEvaluator.accepts(fn)); -} - -function writeTemplate(sourceRoot: string, destRoot: string) { - listFilesExcludingGitignored(sourceRoot).forEach(fn => { - let sourceContent = fs.readFileSync(path.join(sourceRoot, fn)); - - // For text files, replace hardcoded values with template tags - if (isTextFile(fn)) { - let sourceText = sourceContent.toString('utf8'); - contentReplacements.forEach(replacement => { - sourceText = sourceText.replace(replacement.from, replacement.to); - }); - - sourceContent = new Buffer(sourceText, 'utf8'); - } - - // Also apply replacements in filenames - filenameReplacements.forEach(replacement => { - fn = fn.replace(replacement.from, replacement.to); - }); - - writeFileEnsuringDirExists(destRoot, fn, sourceContent); - }); -} - -function copyRecursive(sourceRoot: string, destRoot: string, matchGlob: string) { - glob.sync(matchGlob, { cwd: sourceRoot, dot: true, nodir: true }) - .forEach(fn => { - const sourceContent = fs.readFileSync(path.join(sourceRoot, fn)); - writeFileEnsuringDirExists(destRoot, fn, sourceContent); - }); -} - -const outputRoot = './generator-aspnetcore-spa'; -const outputTemplatesRoot = path.join(outputRoot, 'app/templates'); -rimraf.sync(outputTemplatesRoot); - -// Copy template files -_.forEach(templates, (templateRootDir, templateName) => { - const outputDir = path.join(outputTemplatesRoot, templateName); - writeTemplate(templateRootDir, outputDir); -}); - -// Also copy the generator files (that's the compiled .js files, plus all other non-.ts files) -const tempRoot = './tmp'; -copyRecursive(path.join(tempRoot, 'generator'), outputRoot, '**/*.js'); -copyRecursive('./src/generator', outputRoot, '**/!(*.ts)'); - -// Clean up -rimraf.sync(tempRoot); diff --git a/templates/yeoman/src/generator/.gitignore b/templates/yeoman/src/generator/.gitignore deleted file mode 100644 index 2ccbe465..00000000 --- a/templates/yeoman/src/generator/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules/ diff --git a/templates/yeoman/src/generator/app/index.ts b/templates/yeoman/src/generator/app/index.ts deleted file mode 100644 index ecb53667..00000000 --- a/templates/yeoman/src/generator/app/index.ts +++ /dev/null @@ -1,77 +0,0 @@ -import * as path from 'path'; -import * as yeoman from 'yeoman-generator'; -import * as uuid from 'node-uuid'; -import * as glob from 'glob'; -const yosay = require('yosay'); -const toPascalCase = require('to-pascal-case'); - -const templates = [ - { value: 'angular-2', name: 'Angular 2' }, - { value: 'knockout', name: 'Knockout' }, - { value: 'react', name: 'React' }, - { value: 'react-redux', name: 'React with Redux' } -]; - -class MyGenerator extends yeoman.Base { - private _answers: any; - - constructor(args: string | string[], options: any) { - super(args, options); - this.log(yosay('Welcome to the ASP.NET Core Single-Page App generator!')); - } - - prompting() { - const done = this.async(); - - this.prompt([{ - type: 'list', - name: 'framework', - message: 'Framework', - choices: templates - }, { - type: 'input', - name: 'name', - message: 'Your project name', - default: this.appname - }], answers => { - this._answers = answers; - this._answers.namePascalCase = toPascalCase(answers.name); - this._answers.projectGuid = uuid.v4(); - done(); - }); - } - - writing() { - var templateRoot = this.templatePath(this._answers.framework); - glob.sync('**/*', { cwd: templateRoot, dot: true, nodir: true }).forEach(fn => { - // Token replacement in filenames - let outputFn = fn.replace(/tokenreplace\-([^\.\/]*)/g, (substr, token) => this._answers[token]); - - // Rename template_gitignore to .gitignore in output - if (path.basename(fn) === 'template_gitignore') { - outputFn = path.join(path.dirname(fn), '.gitignore'); - } - - this.fs.copyTpl( - path.join(templateRoot, fn), - this.destinationPath(outputFn), - this._answers - ); - }); - } - - installingDeps() { - this.installDependencies({ - npm: true, - bower: false, - callback: () => { - this.spawnCommandSync('dotnet', ['restore']); - this.spawnCommandSync('./node_modules/.bin/webpack', ['--config', 'webpack.config.vendor.js']); - this.spawnCommandSync('./node_modules/.bin/webpack'); - } - }); - } -} - -declare var module: any; -(module).exports = MyGenerator; diff --git a/templates/yeoman/src/generator/package.json b/templates/yeoman/src/generator/package.json deleted file mode 100644 index ad60454d..00000000 --- a/templates/yeoman/src/generator/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "generator-aspnetcore-spa", - "version": "0.2.2", - "description": "Single-Page App templates for ASP.NET Core", - "author": "Microsoft", - "license": "Apache-2.0", - "files": [ - "app" - ], - "keywords": [ - "yeoman-generator" - ], - "dependencies": { - "glob": "^7.0.3", - "node-uuid": "^1.4.7", - "to-pascal-case": "^1.0.0", - "yeoman-generator": "^0.20.2", - "yosay": "^1.1.1" - } -} diff --git a/templates/yeoman/tsconfig.json b/templates/yeoman/tsconfig.json deleted file mode 100644 index 107dfae8..00000000 --- a/templates/yeoman/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "moduleResolution": "node", - "target": "es5", - "outDir": "tmp", - "sourceMap": false - }, - "exclude": [ - "node_modules", - "generator-aspnetcore-spa" - ] -} diff --git a/templates/yeoman/tsd.json b/templates/yeoman/tsd.json deleted file mode 100644 index 6b9c72bc..00000000 --- a/templates/yeoman/tsd.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "version": "v4", - "repo": "borisyankov/DefinitelyTyped", - "ref": "master", - "path": "typings", - "bundle": "typings/tsd.d.ts", - "installed": { - "yeoman-generator/yeoman-generator.d.ts": { - "commit": "544a35a10866b32afda9c7f029c0764558563f4f" - }, - "node/node.d.ts": { - "commit": "08ed4e9f1869e37e29514d862e0158b40e550232" - }, - "glob/glob.d.ts": { - "commit": "544a35a10866b32afda9c7f029c0764558563f4f" - }, - "minimatch/minimatch.d.ts": { - "commit": "544a35a10866b32afda9c7f029c0764558563f4f" - }, - "lodash/lodash.d.ts": { - "commit": "544a35a10866b32afda9c7f029c0764558563f4f" - }, - "mkdirp/mkdirp.d.ts": { - "commit": "544a35a10866b32afda9c7f029c0764558563f4f" - }, - "rimraf/rimraf.d.ts": { - "commit": "544a35a10866b32afda9c7f029c0764558563f4f" - }, - "node-uuid/node-uuid.d.ts": { - "commit": "08ed4e9f1869e37e29514d862e0158b40e550232" - }, - "node-uuid/node-uuid-base.d.ts": { - "commit": "08ed4e9f1869e37e29514d862e0158b40e550232" - }, - "node-uuid/node-uuid-cjs.d.ts": { - "commit": "08ed4e9f1869e37e29514d862e0158b40e550232" - } - } -} diff --git a/templates/yeoman/typings/gitignore-parser/gitignore-parser.d.ts b/templates/yeoman/typings/gitignore-parser/gitignore-parser.d.ts deleted file mode 100644 index e265ba89..00000000 --- a/templates/yeoman/typings/gitignore-parser/gitignore-parser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare module 'gitignore-parser' { - export function compile(gitignoreContents: string): any; -} diff --git a/templates/yeoman/typings/glob/glob.d.ts b/templates/yeoman/typings/glob/glob.d.ts deleted file mode 100644 index 2957204f..00000000 --- a/templates/yeoman/typings/glob/glob.d.ts +++ /dev/null @@ -1,112 +0,0 @@ -// Type definitions for Glob 5.0.10 -// Project: https://github.com/isaacs/node-glob -// Definitions by: vvakame -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// - -declare module "glob" { - - import events = require("events"); - import fs = require('fs'); - import minimatch = require("minimatch"); - - function G(pattern: string, cb: (err: Error, matches: string[]) => void): void; - function G(pattern: string, options: G.IOptions, cb: (err: Error, matches: string[]) => void): void; - - namespace G { - function sync(pattern: string, options?: IOptions): string[]; - - function hasMagic(pattern: string, options?: IOptions): boolean; - - var Glob: IGlobStatic; - var GlobSync: IGlobSyncStatic; - - interface IOptions extends minimatch.IOptions { - cwd?: string; - root?: string; - dot?: boolean; - nomount?: boolean; - mark?: boolean; - nosort?: boolean; - stat?: boolean; - silent?: boolean; - strict?: boolean; - cache?: { [path: string]: any /* boolean | string | string[] */ }; - statCache?: { [path: string]: fs.Stats }; - symlinks?: any; - sync?: boolean; - nounique?: boolean; - nonull?: boolean; - debug?: boolean; - nobrace?: boolean; - noglobstar?: boolean; - noext?: boolean; - nocase?: boolean; - matchBase?: any; - nodir?: boolean; - ignore?: any; /* string | string[] */ - follow?: boolean; - realpath?: boolean; - nonegate?: boolean; - nocomment?: boolean; - - /** Deprecated. */ - globDebug?: boolean; - } - - interface IGlobStatic extends events.EventEmitter { - new (pattern: string, cb?: (err: Error, matches: string[]) => void): IGlob; - new (pattern: string, options: IOptions, cb?: (err: Error, matches: string[]) => void): IGlob; - prototype: IGlob; - } - - interface IGlobSyncStatic { - new (pattern: string, options?: IOptions): IGlobBase - prototype: IGlobBase; - } - - interface IGlobBase { - minimatch: minimatch.IMinimatch; - options: IOptions; - aborted: boolean; - cache: { [path: string]: any /* boolean | string | string[] */ }; - statCache: { [path: string]: fs.Stats }; - symlinks: { [path: string]: boolean }; - realpathCache: { [path: string]: string }; - found: string[]; - } - - interface IGlob extends IGlobBase, events.EventEmitter { - pause(): void; - resume(): void; - abort(): void; - - /** Deprecated. */ - EOF: any; - /** Deprecated. */ - paused: boolean; - /** Deprecated. */ - maxDepth: number; - /** Deprecated. */ - maxLength: number; - /** Deprecated. */ - changedCwd: boolean; - /** Deprecated. */ - cwd: string; - /** Deprecated. */ - root: string; - /** Deprecated. */ - error: any; - /** Deprecated. */ - matches: string[]; - /** Deprecated. */ - log(...args: any[]): void; - /** Deprecated. */ - emitMatch(m: any): void; - } - } - - export = G; -} diff --git a/templates/yeoman/typings/lodash/lodash.d.ts b/templates/yeoman/typings/lodash/lodash.d.ts deleted file mode 100644 index bd996b96..00000000 --- a/templates/yeoman/typings/lodash/lodash.d.ts +++ /dev/null @@ -1,19265 +0,0 @@ -// Type definitions for Lo-Dash -// Project: http://lodash.com/ -// Definitions by: Brian Zengel , Ilya Mochalov -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -/** -### 4.0.0 Changelog (https://github.com/lodash/lodash/wiki/Changelog) - -#### TODO: -removed: -- [x] Removed _.support -- [x] Removed _.findWhere in favor of _.find with iteratee shorthand -- [x] Removed _.where in favor of _.filter with iteratee shorthand -- [x] Removed _.pluck in favor of _.map with iteratee shorthand - -renamed: -- [x] Renamed _.first to _.head -- [x] Renamed _.indexBy to _.keyBy -- [x] Renamed _.invoke to _.invokeMap -- [x] Renamed _.overArgs to _.overArgs -- [x] Renamed _.padLeft & _.padRight to _.padStart & _.padEnd -- [x] Renamed _.pairs to _.toPairs -- [x] Renamed _.rest to _.tail -- [x] Renamed _.restParam to _.rest -- [x] Renamed _.sortByOrder to _.orderBy -- [x] Renamed _.trimLeft & _.trimRight to _.trimStart & _.trimEnd -- [x] Renamed _.trunc to _.truncate - -split: -- [x] Split _.indexOf & _.lastIndexOf into _.sortedIndexOf & _.sortedLastIndexOf -- [x] Split _.max & _.min into _.maxBy & _.minBy -- [x] Split _.omit & _.pick into _.omitBy & _.pickBy -- [x] Split _.sample into _.sampleSize -- [x] Split _.sortedIndex into _.sortedIndexBy -- [x] Split _.sortedLastIndex into _.sortedLastIndexBy -- [x] Split _.uniq into _.sortedUniq, _.sortedUniqBy, & _.uniqBy - -changes: -- [x] Absorbed _.sortByAll into _.sortBy -- [x] Changed the category of _.at to “Object” -- [x] Changed the category of _.bindAll to “Utility” -- [x] Made _.capitalize uppercase the first character & lowercase the rest -- [x] Made _.functions return only own method names - - -added 23 array methods: -- [x] _.concat -- [x] _.differenceBy -- [x] _.differenceWith -- [x] _.flatMap -- [x] _.fromPairs -- [x] _.intersectionBy -- [x] _.intersectionWith -- [x] _.join -- [x] _.pullAll -- [x] _.pullAllBy -- [x] _.reverse -- [x] _.sortedIndexBy -- [x] _.sortedIndexOf -- [x] _.sortedLastIndexBy -- [x] _.sortedLastIndexOf -- [x] _.sortedUniq -- [x] _.sortedUniqBy -- [x] _.unionBy -- [x] _.unionWith -- [x] _.uniqBy -- [x] _.uniqWith -- [x] _.xorBy -- [x] _.xorWith - -added 18 lang methods: -- [x] _.cloneDeepWith -- [x] _.cloneWith -- [x] _.eq -- [x] _.isArrayLike -- [x] _.isArrayLikeObject -- [x] _.isEqualWith -- [x] _.isInteger -- [x] _.isLength -- [x] _.isMatchWith -- [x] _.isNil -- [x] _.isObjectLike -- [x] _.isSafeInteger -- [x] _.isSymbol -- [x] _.toInteger -- [x] _.toLength -- [x] _.toNumber -- [x] _.toSafeInteger -- [x] _.toString - -added 13 object methods: -- [x] _.assignIn -- [x] _.assignInWith -- [x] _.assignWith -- [x] _.functionsIn -- [x] _.hasIn -- [x] _.mergeWith -- [x] _.omitBy -- [x] _.pickBy - - -added 8 string methods: -- [x] _.lowerCase -- [x] _.lowerFirst -- [x] _.upperCase -- [x] _.upperFirst -- [x] _.toLower -- [x] _.toUpper - -added 8 utility methods: -- [x] _.toPath - -added 4 math methods: -- [x] _.maxBy -- [x] _.mean -- [x] _.minBy -- [x] _.sumBy - -added 2 function methods: -- [x] _.flip -- [x] _.unary - -added 2 number methods: -- [x] _.clamp -- [x] _.subtract - -added collection method: -- [x] _.sampleSize - -Added 3 aliases - -- [x] _.first as an alias of _.head - -Removed 17 aliases -- [x] Removed aliase _.all -- [x] Removed aliase _.any -- [x] Removed aliase _.backflow -- [x] Removed aliase _.callback -- [x] Removed aliase _.collect -- [x] Removed aliase _.compose -- [x] Removed aliase _.contains -- [x] Removed aliase _.detect -- [x] Removed aliase _.foldl -- [x] Removed aliase _.foldr -- [x] Removed aliase _.include -- [x] Removed aliase _.inject -- [x] Removed aliase _.methods -- [x] Removed aliase _.object -- [x] Removed aliase _.run -- [x] Removed aliase _.select -- [x] Removed aliase _.unique - -Other changes -- [x] Added support for array buffers to _.isEqual -- [x] Added support for converting iterators to _.toArray -- [x] Added support for deep paths to _.zipObject -- [x] Changed UMD to export to window or self when available regardless of other exports -- [x] Ensured debounce cancel clears args & thisArg references -- [x] Ensured _.add, _.subtract, & _.sum don’t skip NaN values -- [x] Ensured _.clone treats generators like functions -- [x] Ensured _.clone produces clones with the source’s [[Prototype]] -- [x] Ensured _.defaults assigns properties that shadow Object.prototype -- [x] Ensured _.defaultsDeep doesn’t merge a string into an array -- [x] Ensured _.defaultsDeep & _.merge don’t modify sources -- [x] Ensured _.defaultsDeep works with circular references -- [x] Ensured _.keys skips “length” on strict mode arguments objects in Safari 9 -- [x] Ensured _.merge doesn’t convert strings to arrays -- [x] Ensured _.merge merges plain-objects onto non plain-objects -- [x] Ensured _#plant resets iterator data of cloned sequences -- [x] Ensured _.random swaps min & max if min is greater than max -- [x] Ensured _.range preserves the sign of start of -0 -- [x] Ensured _.reduce & _.reduceRight use getIteratee in their array branch -- [x] Fixed rounding issue with the precision param of _.floor - -** LATER ** -Misc: -- [ ] Made _.forEach, _.forIn, _.forOwn, & _.times implicitly end a chain sequence -- [ ] Removed thisArg params from most methods -- [ ] Made “By” methods provide a single param to iteratees -- [ ] Made _.words chainable by default -- [ ] Removed isDeep params from _.clone & _.flatten -- [ ] Removed _.bindAll support for binding all methods when no names are provided -- [ ] Removed func-first param signature from _.before & _.after -- [ ] _.extend as an alias of _.assignIn -- [ ] _.extendWith as an alias of _.assignInWith -- [ ] Added clear method to _.memoize.Cache -- [ ] Added flush method to debounced & throttled functions -- [ ] Added support for ES6 maps, sets, & symbols to _.clone, _.isEqual, & _.toArray -- [ ] Enabled _.flow & _.flowRight to accept an array of functions -- [ ] Ensured “Collection” methods treat functions as objects -- [ ] Ensured _.assign, _.defaults, & _.merge coerce object values to objects -- [ ] Ensured _.bindKey bound functions call object[key] when called with the new operator -- [ ] Ensured _.isFunction returns true for generator functions -- [ ] Ensured _.merge assigns typed arrays directly -- [ ] Made _(...) an iterator & iterable -- [ ] Made _.drop, _.take, & right forms coerce n of undefined to 0 - -Methods: -- [ ] _.concat -- [ ] _.differenceBy -- [ ] _.differenceWith -- [ ] _.flatMap -- [ ] _.fromPairs -- [ ] _.intersectionBy -- [ ] _.intersectionWith -- [ ] _.join -- [ ] _.pullAll -- [ ] _.pullAllBy -- [ ] _.reverse -- [ ] _.sortedLastIndexOf -- [ ] _.unionBy -- [ ] _.unionWith -- [ ] _.uniqWith -- [ ] _.xorBy -- [ ] _.xorWith -- [ ] _.toString - -- [ ] _.invoke -- [ ] _.setWith -- [ ] _.toPairs -- [ ] _.toPairsIn -- [ ] _.unset - -- [ ] _.replace -- [ ] _.split - -- [ ] _.cond -- [ ] _.conforms -- [ ] _.nthArg -- [ ] _.over -- [ ] _.overEvery -- [ ] _.overSome -- [ ] _.rangeRight - -- [ ] _.next -*/ - -declare var _: _.LoDashStatic; - -declare module _ { - interface LoDashStatic { - /** - * Creates a lodash object which wraps the given value to enable intuitive method chaining. - * - * In addition to Lo-Dash methods, wrappers also have the following Array methods: - * concat, join, pop, push, reverse, shift, slice, sort, splice, and unshift - * - * Chaining is supported in custom builds as long as the value method is implicitly or - * explicitly included in the build. - * - * The chainable wrapper functions are: - * after, assign, bind, bindAll, bindKey, chain, chunk, compact, compose, concat, countBy, - * createCallback, curry, debounce, defaults, defer, delay, difference, filter, flatten, - * forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, functions, groupBy, - * keyBy, initial, intersection, invert, invoke, keys, map, max, memoize, merge, min, - * object, omit, once, pairs, partial, partialRight, pick, pluck, pull, push, range, reject, - * remove, rest, reverse, sample, shuffle, slice, sort, sortBy, splice, tap, throttle, times, - * toArray, transform, union, uniq, unset, unshift, unzip, values, where, without, wrap, and zip - * - * The non-chainable wrapper functions are: - * clone, cloneDeep, contains, escape, every, find, findIndex, findKey, findLast, - * findLastIndex, findLastKey, has, identity, indexOf, isArguments, isArray, isBoolean, - * isDate, isElement, isEmpty, isEqual, isFinite, isFunction, isNaN, isNull, isNumber, - * isObject, isPlainObject, isRegExp, isString, isUndefined, join, lastIndexOf, mixin, - * noConflict, parseInt, pop, random, reduce, reduceRight, result, shift, size, some, - * sortedIndex, runInContext, template, unescape, uniqueId, and value - * - * The wrapper functions first and last return wrapped values when n is provided, otherwise - * they return unwrapped values. - * - * Explicit chaining can be enabled by using the _.chain method. - **/ - (value: number): LoDashImplicitWrapper; - (value: string): LoDashImplicitStringWrapper; - (value: boolean): LoDashImplicitWrapper; - (value: Array): LoDashImplicitNumberArrayWrapper; - (value: Array): LoDashImplicitArrayWrapper; - (value: T): LoDashImplicitObjectWrapper; - (value: any): LoDashImplicitWrapper; - - /** - * The semantic version number. - **/ - VERSION: string; - - /** - * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby - * (ERB). Change the following template settings to use alternative delimiters. - **/ - templateSettings: TemplateSettings; - } - - /** - * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby - * (ERB). Change the following template settings to use alternative delimiters. - **/ - interface TemplateSettings { - /** - * The "escape" delimiter. - **/ - escape?: RegExp; - - /** - * The "evaluate" delimiter. - **/ - evaluate?: RegExp; - - /** - * An object to import into the template as local variables. - **/ - imports?: Dictionary; - - /** - * The "interpolate" delimiter. - **/ - interpolate?: RegExp; - - /** - * Used to reference the data object in the template text. - **/ - variable?: string; - } - - /** - * Creates a cache object to store key/value pairs. - */ - interface MapCache { - /** - * Removes `key` and its value from the cache. - * @param key The key of the value to remove. - * @return Returns `true` if the entry was removed successfully, else `false`. - */ - delete(key: string): boolean; - - /** - * Gets the cached value for `key`. - * @param key The key of the value to get. - * @return Returns the cached value. - */ - get(key: string): any; - - /** - * Checks if a cached value for `key` exists. - * @param key The key of the entry to check. - * @return Returns `true` if an entry for `key` exists, else `false`. - */ - has(key: string): boolean; - - /** - * Sets `value` to `key` of the cache. - * @param key The key of the value to cache. - * @param value The value to cache. - * @return Returns the cache object. - */ - set(key: string, value: any): _.Dictionary; - } - - interface LoDashWrapperBase { } - - interface LoDashImplicitWrapperBase extends LoDashWrapperBase { } - - interface LoDashExplicitWrapperBase extends LoDashWrapperBase { } - - interface LoDashImplicitWrapper extends LoDashImplicitWrapperBase> { } - - interface LoDashExplicitWrapper extends LoDashExplicitWrapperBase> { } - - interface LoDashImplicitStringWrapper extends LoDashImplicitWrapper { } - - interface LoDashExplicitStringWrapper extends LoDashExplicitWrapper { } - - interface LoDashImplicitObjectWrapper extends LoDashImplicitWrapperBase> { } - - interface LoDashExplicitObjectWrapper extends LoDashExplicitWrapperBase> { } - - interface LoDashImplicitArrayWrapper extends LoDashImplicitWrapperBase> { - pop(): T; - push(...items: T[]): LoDashImplicitArrayWrapper; - shift(): T; - sort(compareFn?: (a: T, b: T) => number): LoDashImplicitArrayWrapper; - splice(start: number): LoDashImplicitArrayWrapper; - splice(start: number, deleteCount: number, ...items: any[]): LoDashImplicitArrayWrapper; - unshift(...items: T[]): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper extends LoDashExplicitWrapperBase> { } - - interface LoDashImplicitNumberArrayWrapper extends LoDashImplicitArrayWrapper { } - - interface LoDashExplicitNumberArrayWrapper extends LoDashExplicitArrayWrapper { } - - /********* - * Array * - *********/ - - //_.chunk - interface LoDashStatic { - /** - * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the - * final chunk will be the remaining elements. - * - * @param array The array to process. - * @param size The length of each chunk. - * @return Returns the new array containing chunks. - */ - chunk( - array: List, - size?: number - ): T[][]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.chunk - */ - chunk(size?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.chunk - */ - chunk(size?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.chunk - */ - chunk(size?: number): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.chunk - */ - chunk(size?: number): LoDashExplicitArrayWrapper; - } - - //_.compact - interface LoDashStatic { - /** - * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are - * falsey. - * - * @param array The array to compact. - * @return (Array) Returns the new array of filtered values. - */ - compact(array?: List): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.compact - */ - compact(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.compact - */ - compact(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.compact - */ - compact(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.compact - */ - compact(): LoDashExplicitArrayWrapper; - } - - //_.concat DUMMY - interface LoDashStatic { - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - concat(...values: (T[]|List)[]) : T[]; - } - - //_.difference - interface LoDashStatic { - /** - * Creates an array of unique array values not included in the other provided arrays using SameValueZero for - * equality comparisons. - * - * @param array The array to inspect. - * @param values The arrays of values to exclude. - * @return Returns the new array of filtered values. - */ - difference( - array: T[]|List, - ...values: Array> - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.difference - */ - difference(...values: (T[]|List)[]): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.difference - */ - difference(...values: (TValue[]|List)[]): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.difference - */ - difference(...values: (T[]|List)[]): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.difference - */ - difference(...values: (TValue[]|List)[]): LoDashExplicitArrayWrapper; - } - - //_.differenceBy - interface LoDashStatic { - /** - * This method is like _.difference except that it accepts iteratee which is invoked for each element of array - * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one - * argument: (value). - * - * @param array The array to inspect. - * @param values The values to exclude. - * @param iteratee The iteratee invoked per element. - * @returns Returns the new array of filtered values. - */ - differenceBy( - array: T[]|List, - values?: T[]|List, - iteratee?: ((value: T) => any)|string - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: T[]|List, - values?: T[]|List, - iteratee?: W - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - iteratee?: ((value: T) => any)|string - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - iteratee?: W - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - iteratee?: ((value: T) => any)|string - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - iteratee?: W - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - iteratee?: W - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - iteratee?: ((value: T) => any)|string - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, - iteratee?: ((value: T) => any)|string - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, - iteratee?: W - ): T[]; - - /** - * @see _.differenceBy - */ - differenceBy( - array: T[]|List, - ...values: any[] - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.differenceBy - */ - differenceBy( - values?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values?: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - ...values: any[] - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.differenceBy - */ - differenceBy( - values?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values?: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - ...values: any[] - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.differenceBy - */ - differenceBy( - values?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values?: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - ...values: any[] - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.differenceBy - */ - differenceBy( - values?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values?: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, - iteratee?: ((value: T) => any)|string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.differenceBy - */ - differenceBy( - ...values: any[] - ): LoDashExplicitArrayWrapper; - } - - //_.differenceWith DUMMY - interface LoDashStatic { - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.difference([3, 2, 1], [4, 2]); - * // => [3, 1] - */ - differenceWith( - array: any[]|List, - ...values: any[] - ): any[]; - } - - //_.drop - interface LoDashStatic { - /** - * Creates a slice of array with n elements dropped from the beginning. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - drop(array: T[]|List, n?: number): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.drop - */ - drop(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.drop - */ - drop(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.drop - */ - drop(n?: number): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.drop - */ - drop(n?: number): LoDashExplicitArrayWrapper; - } - - //_.dropRight - interface LoDashStatic { - /** - * Creates a slice of array with n elements dropped from the end. - * - * @param array The array to query. - * @param n The number of elements to drop. - * @return Returns the slice of array. - */ - dropRight( - array: List, - n?: number - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.dropRight - */ - dropRight(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.dropRight - */ - dropRight(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.dropRight - */ - dropRight(n?: number): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.dropRight - */ - dropRight(n?: number): LoDashExplicitArrayWrapper; - } - - //_.dropRightWhile - interface LoDashStatic { - /** - * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - dropRightWhile( - array: List, - predicate?: ListIterator, - thisArg?: any - ): TValue[]; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - array: List, - predicate?: string, - thisArg?: any - ): TValue[]; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - array: List, - predicate?: TWhere - ): TValue[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropRightWhile - */ - dropRightWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - //_.dropWhile - interface LoDashStatic { - /** - * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - dropWhile( - array: List, - predicate?: ListIterator, - thisArg?: any - ): TValue[]; - - /** - * @see _.dropWhile - */ - dropWhile( - array: List, - predicate?: string, - thisArg?: any - ): TValue[]; - - /** - * @see _.dropWhile - */ - dropWhile( - array: List, - predicate?: TWhere - ): TValue[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.dropWhile - */ - dropWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - //_.fill - interface LoDashStatic { - /** - * Fills elements of array with value from start up to, but not including, end. - * - * Note: This method mutates array. - * - * @param array The array to fill. - * @param value The value to fill array with. - * @param start The start position. - * @param end The end position. - * @return Returns array. - */ - fill( - array: any[], - value: T, - start?: number, - end?: number - ): T[]; - - /** - * @see _.fill - */ - fill( - array: List, - value: T, - start?: number, - end?: number - ): List; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.fill - */ - fill( - value: T, - start?: number, - end?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.fill - */ - fill( - value: T, - start?: number, - end?: number - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.fill - */ - fill( - value: T, - start?: number, - end?: number - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.fill - */ - fill( - value: T, - start?: number, - end?: number - ): LoDashExplicitObjectWrapper>; - } - - //_.findIndex - interface LoDashStatic { - /** - * This method is like _.find except that it returns the index of the first element predicate returns truthy - * for instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the index of the found element, else -1. - */ - findIndex( - array: List, - predicate?: ListIterator, - thisArg?: any - ): number; - - /** - * @see _.findIndex - */ - findIndex( - array: List, - predicate?: string, - thisArg?: any - ): number; - - /** - * @see _.findIndex - */ - findIndex( - array: List, - predicate?: W - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.findIndex - */ - findIndex( - predicate?: ListIterator, - thisArg?: any - ): number; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: string, - thisArg?: any - ): number; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: W - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.findIndex - */ - findIndex( - predicate?: ListIterator, - thisArg?: any - ): number; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: string, - thisArg?: any - ): number; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: W - ): number; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.findIndex - */ - findIndex( - predicate?: ListIterator, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: string, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: W - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.findIndex - */ - findIndex( - predicate?: ListIterator, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: string, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.findIndex - */ - findIndex( - predicate?: W - ): LoDashExplicitWrapper; - } - - //_.findLastIndex - interface LoDashStatic { - /** - * This method is like _.findIndex except that it iterates over elements of collection from right to left. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to search. - * @param predicate The function invoked per iteration. - * @param thisArg The function invoked per iteration. - * @return Returns the index of the found element, else -1. - */ - findLastIndex( - array: List, - predicate?: ListIterator, - thisArg?: any - ): number; - - /** - * @see _.findLastIndex - */ - findLastIndex( - array: List, - predicate?: string, - thisArg?: any - ): number; - - /** - * @see _.findLastIndex - */ - findLastIndex( - array: List, - predicate?: W - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: ListIterator, - thisArg?: any - ): number; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: string, - thisArg?: any - ): number; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: W - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: ListIterator, - thisArg?: any - ): number; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: string, - thisArg?: any - ): number; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: W - ): number; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: ListIterator, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: string, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: W - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: ListIterator, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: string, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.findLastIndex - */ - findLastIndex( - predicate?: W - ): LoDashExplicitWrapper; - } - - //_.first - interface LoDashStatic { - /** - * @see _.head - */ - first(array: List): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.head - */ - first(): string; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.head - */ - first(): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.head - */ - first(): T; - } - - interface LoDashExplicitWrapper { - /** - * @see _.head - */ - first(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.head - */ - first(): T; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.head - */ - first(): T; - } - - interface RecursiveArray extends Array> {} - interface ListOfRecursiveArraysOrValues extends List> {} - - //_.flatten - interface LoDashStatic { - /** - * Flattens a nested array. If isDeep is true the array is recursively flattened, otherwise it’s only - * flattened a single level. - * - * @param array The array to flatten. - * @param isDeep Specify a deep flatten. - * @return Returns the new flattened array. - */ - flatten(array: ListOfRecursiveArraysOrValues, isDeep: boolean): T[]; - - /** - * @see _.flatten - */ - flatten(array: List): T[]; - - /** - * @see _.flatten - */ - flatten(array: ListOfRecursiveArraysOrValues): RecursiveArray; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flatten - */ - flatten(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.flatten - */ - flatten(isDeep?: boolean): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.flatten - */ - flatten(isDeep?: boolean): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flatten - */ - flatten(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.flatten - */ - flatten(isDeep?: boolean): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.flatten - */ - flatten(isDeep?: boolean): LoDashExplicitArrayWrapper; - } - - //_.flattenDeep - interface LoDashStatic { - /** - * Recursively flattens a nested array. - * - * @param array The array to recursively flatten. - * @return Returns the new flattened array. - */ - flattenDeep(array: ListOfRecursiveArraysOrValues): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.flattenDeep - */ - flattenDeep(): LoDashExplicitArrayWrapper; - } - - //_.fromPairs DUMMY - interface LoDashStatic { - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} pairs The key-value pairs. - * @returns {Object} Returns the new object. - * @example - * - * _.fromPairs([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - */ - fromPairs( - array: any[]|List - ): any[]; - } - - //_.head - interface LoDashStatic { - /** - * Gets the first element of array. - * - * @alias _.first - * - * @param array The array to query. - * @return Returns the first element of array. - */ - head(array: List): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.head - */ - head(): string; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.head - */ - head(): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.head - */ - head(): T; - } - - interface LoDashExplicitWrapper { - /** - * @see _.head - */ - head(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.head - */ - head(): T; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.head - */ - head(): T; - } - - //_.indexOf - interface LoDashStatic { - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` - * performs a faster binary search. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - indexOf( - array: List, - value: T, - fromIndex?: boolean|number - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.indexOf - */ - indexOf( - value: T, - fromIndex?: boolean|number - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.indexOf - */ - indexOf( - value: TValue, - fromIndex?: boolean|number - ): number; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.indexOf - */ - indexOf( - value: T, - fromIndex?: boolean|number - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.indexOf - */ - indexOf( - value: TValue, - fromIndex?: boolean|number - ): LoDashExplicitWrapper; - } - - //_.intersectionBy DUMMY - interface LoDashStatic { - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // using the `_.property` iteratee shorthand - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - intersectionBy( - array: any[]|List, - ...values: any[] - ): any[]; - } - - //_.intersectionWith DUMMY - interface LoDashStatic { - /** - * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - intersectionWith( - array: any[]|List, - ...values: any[] - ): any[]; - } - - //_.join - interface LoDashStatic { - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @param array The array to convert. - * @param separator The element separator. - * @returns Returns the joined string. - */ - join( - array: List, - separator?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.join - */ - join(separator?: string): string; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.join - */ - join(separator?: string): string; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.join - */ - join(separator?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.join - */ - join(separator?: string): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.join - */ - join(separator?: string): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.join - */ - join(separator?: string): LoDashExplicitWrapper; - } - - //_.pullAll DUMMY - interface LoDashStatic { - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - pullAll( - array: any[]|List, - ...values: any[] - ): any[]; - } - - //_.pullAllBy DUMMY - interface LoDashStatic { - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - pullAllBy( - array: any[]|List, - ...values: any[] - ): any[]; - } - - //_.reverse DUMMY - interface LoDashStatic { - /** - * Reverses `array` so that the first element becomes the last, the second - * element becomes the second to last, and so on. - * - * **Note:** This method mutates `array` and is based on - * [`Array#reverse`](https://mdn.io/Array/reverse). - * - * @memberOf _ - * @category Array - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.reverse(array); - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - reverse( - array: any[]|List, - ...values: any[] - ): any[]; - } - - //_.sortedIndexOf - interface LoDashStatic { - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - sortedIndexOf( - array: List, - value: T - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortedIndexOf - */ - sortedIndexOf( - value: T - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sortedIndexOf - */ - sortedIndexOf( - value: TValue - ): number; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortedIndexOf - */ - sortedIndexOf( - value: T - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortedIndexOf - */ - sortedIndexOf( - value: TValue - ): LoDashExplicitWrapper; - } - - //_.initial - interface LoDashStatic { - /** - * Gets all but the last element of array. - * - * @param array The array to query. - * @return Returns the slice of array. - */ - initial(array: List): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.initial - */ - initial(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.initial - */ - initial(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.initial - */ - initial(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.initial - */ - initial(): LoDashExplicitArrayWrapper; - } - - //_.intersection - interface LoDashStatic { - /** - * Creates an array of unique values that are included in all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of shared values. - */ - intersection(...arrays: (T[]|List)[]): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.intersection - */ - intersection(...arrays: (TResult[]|List)[]): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.intersection - */ - intersection(...arrays: (TResult[]|List)[]): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.intersection - */ - intersection(...arrays: (TResult[]|List)[]): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.intersection - */ - intersection(...arrays: (TResult[]|List)[]): LoDashExplicitArrayWrapper; - } - - //_.last - interface LoDashStatic { - /** - * Gets the last element of array. - * - * @param array The array to query. - * @return Returns the last element of array. - */ - last(array: List): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.last - */ - last(): string; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.last - */ - last(): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.last - */ - last(): T; - } - - interface LoDashExplicitWrapper { - /** - * @see _.last - */ - last(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.last - */ - last(): T; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.last - */ - last(): T; - } - - //_.lastIndexOf - interface LoDashStatic { - /** - * This method is like _.indexOf except that it iterates over elements of array from right to left. - * - * @param array The array to search. - * @param value The value to search for. - * @param fromIndex The index to search from or true to perform a binary search on a sorted array. - * @return Returns the index of the matched value, else -1. - */ - lastIndexOf( - array: List, - value: T, - fromIndex?: boolean|number - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.lastIndexOf - */ - lastIndexOf( - value: T, - fromIndex?: boolean|number - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.lastIndexOf - */ - lastIndexOf( - value: TResult, - fromIndex?: boolean|number - ): number; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.lastIndexOf - */ - lastIndexOf( - value: T, - fromIndex?: boolean|number - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.lastIndexOf - */ - lastIndexOf( - value: TResult, - fromIndex?: boolean|number - ): LoDashExplicitWrapper; - } - - //_.pull - interface LoDashStatic { - /** - * Removes all provided values from array using SameValueZero for equality comparisons. - * - * Note: Unlike _.without, this method mutates array. - * - * @param array The array to modify. - * @param values The values to remove. - * @return Returns array. - */ - pull( - array: T[], - ...values: T[] - ): T[]; - - /** - * @see _.pull - */ - pull( - array: List, - ...values: T[] - ): List; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.pull - */ - pull(...values: T[]): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.pull - */ - pull(...values: TValue[]): LoDashImplicitObjectWrapper>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.pull - */ - pull(...values: T[]): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.pull - */ - pull(...values: TValue[]): LoDashExplicitObjectWrapper>; - } - - //_.pullAt - interface LoDashStatic { - /** - * Removes elements from array corresponding to the given indexes and returns an array of the removed elements. - * Indexes may be specified as an array of indexes or as individual arguments. - * - * Note: Unlike _.at, this method mutates array. - * - * @param array The array to modify. - * @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes. - * @return Returns the new array of removed elements. - */ - pullAt( - array: List, - ...indexes: (number|number[])[] - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.pullAt - */ - pullAt(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.pullAt - */ - pullAt(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.pullAt - */ - pullAt(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.pullAt - */ - pullAt(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper; - } - - //_.remove - interface LoDashStatic { - /** - * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Note: Unlike _.filter, this method mutates array. - * - * @param array The array to modify. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new array of removed elements. - */ - remove( - array: List, - predicate?: ListIterator, - thisArg?: any - ): T[]; - - /** - * @see _.remove - */ - remove( - array: List, - predicate?: string, - thisArg?: any - ): T[]; - - /** - * @see _.remove - */ - remove( - array: List, - predicate?: W - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.remove - */ - remove( - predicate?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: W - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.remove - */ - remove( - predicate?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: W - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.remove - */ - remove( - predicate?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: W - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.remove - */ - remove( - predicate?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: W - ): LoDashExplicitArrayWrapper; - } - - //_.tail - interface LoDashStatic { - /** - * Gets all but the first element of array. - * - * @alias _.tail - * - * @param array The array to query. - * @return Returns the slice of array. - */ - tail(array: List): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.tail - */ - tail(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.tail - */ - tail(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.tail - */ - tail(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.tail - */ - tail(): LoDashExplicitArrayWrapper; - } - - //_.slice - interface LoDashStatic { - /** - * Creates a slice of array from start up to, but not including, end. - * - * @param array The array to slice. - * @param start The start position. - * @param end The end position. - * @return Returns the slice of array. - */ - slice( - array: T[], - start?: number, - end?: number - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.slice - */ - slice( - start?: number, - end?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.slice - */ - slice( - start?: number, - end?: number - ): LoDashExplicitArrayWrapper; - } - - //_.sortedIndex - interface LoDashStatic { - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - sortedIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedIndex - */ - sortedIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedIndex - */ - sortedIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedIndex - */ - sortedIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedIndex - */ - sortedIndex( - array: List, - value: T - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - value: string - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): number; - - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): number; - - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): number; - - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - value: string - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndex - */ - sortedIndex( - value: T - ): LoDashExplicitWrapper; - - - } - - //_.sortedIndexBy - interface LoDashStatic { - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // using the `_.property` iteratee shorthand - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - sortedIndexBy( - array: List, - value: T, - iteratee: (x: T) => TSort - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - array: List, - value: T, - iteratee: (x: T) => any - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - array: List, - value: T, - iteratee: string - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - array: List, - value: T, - iteratee: W - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - array: List, - value: T, - iteratee: Object - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: string, - iteratee: (x: string) => TSort - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: (x: T) => TSort - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: string - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: W - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: (x: T) => TSort - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: (x: T) => any - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: string - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: W - ): number; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: Object - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: string, - iteratee: (x: string) => TSort - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: (x: T) => TSort - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: string - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: W - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: (x: T) => TSort - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: (x: T) => any - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: string - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: W - ): LoDashExplicitWrapper; - - /** - * @see _.sortedIndexBy - */ - sortedIndexBy( - value: T, - iteratee: Object - ): LoDashExplicitWrapper; - } - - //_.sortedLastIndex - interface LoDashStatic { - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - sortedLastIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - array: List, - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - array: List, - value: T - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: string - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): number; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: string - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndex - */ - sortedLastIndex( - value: T - ): LoDashExplicitWrapper; - } - - //_.sortedLastIndexBy - interface LoDashStatic { - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted into `array`. - * @example - * - * // using the `_.property` iteratee shorthand - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - sortedLastIndexBy( - array: List, - value: T, - iteratee: (x: T) => TSort - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - array: List, - value: T, - iteratee: (x: T) => any - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - array: List, - value: T, - iteratee: string - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - array: List, - value: T, - iteratee: W - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - array: List, - value: T, - iteratee: Object - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: string, - iteratee: (x: string) => TSort - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: (x: T) => TSort - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: string - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: W - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: (x: T) => TSort - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: (x: T) => any - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: string - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: W - ): number; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: Object - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: string, - iteratee: (x: string) => TSort - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: (x: T) => TSort - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: string - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: W - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: (x: T) => TSort - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: (x: T) => any - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: string - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: W - ): LoDashExplicitWrapper; - - /** - * @see _.sortedLastIndexBy - */ - sortedLastIndexBy( - value: T, - iteratee: Object - ): LoDashExplicitWrapper; - } - - //_.sortedLastIndexOf DUMMY - interface LoDashStatic { - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - sortedLastIndexOf( - array: any[]|List, - ...values: any[] - ): any[]; - } - - //_.tail - interface LoDashStatic { - /** - * @see _.rest - */ - tail(array: List): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.rest - */ - tail(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.rest - */ - tail(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.rest - */ - tail(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.rest - */ - tail(): LoDashExplicitArrayWrapper; - } - - //_.take - interface LoDashStatic { - /** - * Creates a slice of array with n elements taken from the beginning. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - take( - array: List, - n?: number - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.take - */ - take(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.take - */ - take(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.take - */ - take(n?: number): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.take - */ - take(n?: number): LoDashExplicitArrayWrapper; - } - - //_.takeRight - interface LoDashStatic { - /** - * Creates a slice of array with n elements taken from the end. - * - * @param array The array to query. - * @param n The number of elements to take. - * @return Returns the slice of array. - */ - takeRight( - array: List, - n?: number - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.takeRight - */ - takeRight(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.takeRight - */ - takeRight(n?: number): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.takeRight - */ - takeRight(n?: number): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.takeRight - */ - takeRight(n?: number): LoDashExplicitArrayWrapper; - } - - //_.takeRightWhile - interface LoDashStatic { - /** - * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - takeRightWhile( - array: List, - predicate?: ListIterator, - thisArg?: any - ): TValue[]; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - array: List, - predicate?: string, - thisArg?: any - ): TValue[]; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - array: List, - predicate?: TWhere - ): TValue[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeRightWhile - */ - takeRightWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - //_.takeWhile - interface LoDashStatic { - /** - * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param array The array to query. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the slice of array. - */ - takeWhile( - array: List, - predicate?: ListIterator, - thisArg?: any - ): TValue[]; - - /** - * @see _.takeWhile - */ - takeWhile( - array: List, - predicate?: string, - thisArg?: any - ): TValue[]; - - /** - * @see _.takeWhile - */ - takeWhile( - array: List, - predicate?: TWhere - ): TValue[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.takeWhile - */ - takeWhile( - predicate?: TWhere - ): LoDashExplicitArrayWrapper; - } - - //_.union - interface LoDashStatic { - /** - * Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for - * equality comparisons. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of combined values. - */ - union(...arrays: List[]): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.union - */ - union(...arrays: List[]): LoDashImplicitArrayWrapper; - - /** - * @see _.union - */ - union(...arrays: List[]): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.union - */ - union(...arrays: List[]): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.union - */ - union(...arrays: List[]): LoDashExplicitArrayWrapper; - - /** - * @see _.union - */ - union(...arrays: List[]): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.union - */ - union(...arrays: List[]): LoDashExplicitArrayWrapper; - } - - //_.unionBy - interface LoDashStatic { - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @param arrays The arrays to inspect. - * @param iteratee The iteratee invoked per element. - * @return Returns the new array of combined values. - */ - unionBy( - arrays: T[]|List, - iteratee?: (value: T) => any - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays: T[]|List, - iteratee?: W - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - iteratee?: (value: T) => any - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - iteratee?: W - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, - iteratee?: (value: T) => any - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, - iteratee?: W - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - iteratee?: (value: T) => any - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - iteratee?: W - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, - iteratee?: (value: T) => any - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, - iteratee?: W - ): T[]; - - /** - * @see _.unionBy - */ - unionBy( - arrays: T[]|List, - ...iteratee: any[] - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.unionBy - */ - unionBy( - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - ...iteratee: any[] - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.unionBy - */ - unionBy( - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, - iteratee?: (value: T) => any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, - iteratee?: W - ): LoDashImplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - ...iteratee: any[] - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.unionBy - */ - unionBy( - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - ...iteratee: any[] - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.unionBy - */ - unionBy( - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, - iteratee?: (value: T) => any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, - iteratee?: W - ): LoDashExplicitArrayWrapper; - - /** - * @see _.unionBy - */ - unionBy( - ...iteratee: any[] - ): LoDashExplicitArrayWrapper; - } - - //_.uniq - interface LoDashStatic { - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - */ - uniq( - array: List - ): T[]; - - /** - * @see _.uniq - */ - uniq( - array: List - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.uniq - */ - uniq(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.uniq - */ - uniq(): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - uniq(): LoDashImplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.uniq - */ - uniq(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.uniq - */ - uniq(): LoDashExplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.uniq - */ - uniq(): LoDashExplicitArrayWrapper; - - /** - * @see _.uniq - */ - uniq(): LoDashExplicitArrayWrapper; - } - - //_.uniqBy - interface LoDashStatic { - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // using the `_.property` iteratee shorthand - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - uniqBy( - array: List, - iteratee: ListIterator - ): T[]; - - /** - * @see _.uniqBy - */ - uniqBy( - array: List, - iteratee: ListIterator - ): T[]; - - /** - * @see _.uniqBy - */ - uniqBy( - array: List, - iteratee: string - ): T[]; - - /** - * @see _.uniqBy - */ - uniqBy( - array: List, - iteratee: Object - ): T[]; - - /** - * @see _.uniqBy - */ - uniqBy( - array: List, - iteratee: TWhere - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: Object - ): LoDashImplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: TWhere - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: Object - ): LoDashExplicitArrayWrapper; - - /** - * @see _.uniqBy - */ - uniqBy( - iteratee: TWhere - ): LoDashExplicitArrayWrapper; - } - - //_.sortedUniq - interface LoDashStatic { - /** - * This method is like `_.uniq` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniq([1, 1, 2]); - * // => [1, 2] - */ - sortedUniq( - array: List - ): T[]; - - /** - * @see _.sortedUniq - */ - sortedUniq( - array: List - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - sortedUniq(): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniq - */ - sortedUniq(): LoDashExplicitArrayWrapper; - } - - //_.sortedUniqBy - interface LoDashStatic { - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.2] - */ - sortedUniqBy( - array: List, - iteratee: ListIterator - ): T[]; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - array: List, - iteratee: ListIterator - ): T[]; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - array: List, - iteratee: string - ): T[]; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - array: List, - iteratee: Object - ): T[]; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - array: List, - iteratee: TWhere - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: Object - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: TWhere - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: TWhere - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: Object - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - iteratee: TWhere - ): LoDashExplicitArrayWrapper; - } - - //_.unionWith DUMMY - interface LoDashStatic { - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - unionWith( - array: any[]|List, - ...values: any[] - ): any[]; - } - - //_.uniqWith DUMMY - interface LoDashStatic { - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - uniqWith( - array: any[]|List, - ...values: any[] - ): any[]; - } - - //_.unzip - interface LoDashStatic { - /** - * This method is like _.zip except that it accepts an array of grouped elements and creates an array - * regrouping the elements to their pre-zip configuration. - * - * @param array The array of grouped elements to process. - * @return Returns the new array of regrouped elements. - */ - unzip(array: List>): T[][]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.unzip - */ - unzip(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.unzip - */ - unzip(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.unzip - */ - unzip(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.unzip - */ - unzip(): LoDashExplicitArrayWrapper; - } - - //_.unzipWith - interface LoDashStatic { - /** - * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * - * @param array The array of grouped elements to process. - * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. - * @return Returns the new array of regrouped elements. - */ - unzipWith( - array: List>, - iteratee?: MemoIterator, - thisArg?: any - ): TResult[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.unzipWith - */ - unzipWith( - iteratee?: MemoIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.unzipWith - */ - unzipWith( - iteratee?: MemoIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - } - - //_.without - interface LoDashStatic { - /** - * Creates an array excluding all provided values using SameValueZero for equality comparisons. - * - * @param array The array to filter. - * @param values The values to exclude. - * @return Returns the new array of filtered values. - */ - without( - array: List, - ...values: T[] - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.without - */ - without(...values: T[]): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.without - */ - without(...values: T[]): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.without - */ - without(...values: T[]): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.without - */ - without(...values: T[]): LoDashExplicitArrayWrapper; - } - - //_.xor - interface LoDashStatic { - /** - * Creates an array of unique values that is the symmetric difference of the provided arrays. - * - * @param arrays The arrays to inspect. - * @return Returns the new array of values. - */ - xor(...arrays: List[]): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.xor - */ - xor(...arrays: List[]): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.xor - */ - xor(...arrays: List[]): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.xor - */ - xor(...arrays: List[]): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.xor - */ - xor(...arrays: List[]): LoDashExplicitArrayWrapper; - } - - //_.xorBy DUMMY - interface LoDashStatic { - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // using the `_.property` iteratee shorthand - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - xorBy( - array: any[]|List, - ...values: any[] - ): any[]; - } - - //_.xorWith DUMMY - interface LoDashStatic { - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - xorWith( - array: any[]|List, - ...values: any[] - ): any[]; - } - - //_.zip - interface LoDashStatic { - /** - * Creates an array of grouped elements, the first of which contains the first elements of the given arrays, - * the second of which contains the second elements of the given arrays, and so on. - * - * @param arrays The arrays to process. - * @return Returns the new array of grouped elements. - */ - zip(...arrays: List[]): T[][]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.zip - */ - zip(...arrays: List[]): _.LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.zip - */ - zip(...arrays: List[]): _.LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.zip - */ - zip(...arrays: List[]): _.LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.zip - */ - zip(...arrays: List[]): _.LoDashExplicitArrayWrapper; - } - - //_.zipObject - interface LoDashStatic { - /** - * The inverse of _.pairs; this method returns an object composed from arrays of property names and values. - * Provide either a single two dimensional array, e.g. [[key1, value1], [key2, value2]] or two arrays, one of - * property names and one of corresponding values. - * - * @param props The property names. - * @param values The property values. - * @return Returns the new object. - */ - zipObject( - props: List|List>, - values?: List - ): TResult; - - /** - * @see _.zipObject - */ - zipObject( - props: List|List>, - values?: List - ): TResult; - - /** - * @see _.zipObject - */ - zipObject( - props: List|List>, - values?: List - ): _.Dictionary; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashImplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashImplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashImplicitObjectWrapper<_.Dictionary>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashImplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashImplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashImplicitObjectWrapper<_.Dictionary>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashExplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashExplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashExplicitObjectWrapper<_.Dictionary>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashExplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashExplicitObjectWrapper; - - /** - * @see _.zipObject - */ - zipObject( - values?: List - ): _.LoDashExplicitObjectWrapper<_.Dictionary>; - } - - //_.zipWith - interface LoDashStatic { - /** - * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee] The function to combine grouped values. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @return Returns the new array of grouped elements. - */ - zipWith(...args: any[]): TResult[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.zipWith - */ - zipWith(...args: any[]): LoDashImplicitArrayWrapper; - } - - /********* - * Chain * - *********/ - - //_.chain - interface LoDashStatic { - /** - * Creates a lodash object that wraps value with explicit method chaining enabled. - * - * @param value The value to wrap. - * @return Returns the new lodash wrapper instance. - */ - chain(value: number): LoDashExplicitWrapper; - chain(value: string): LoDashExplicitWrapper; - chain(value: boolean): LoDashExplicitWrapper; - chain(value: T[]): LoDashExplicitArrayWrapper; - chain(value: T): LoDashExplicitObjectWrapper; - chain(value: any): LoDashExplicitWrapper; - } - - interface LoDashImplicitWrapper { - /** - * @see _.chain - */ - chain(): LoDashExplicitWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.chain - */ - chain(): LoDashExplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.chain - */ - chain(): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.chain - */ - chain(): TWrapper; - } - - //_.tap - interface LoDashStatic { - /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one - * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. - * @return Returns value. - **/ - tap( - value: T, - interceptor: (value: T) => void, - thisArg?: any - ): T; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.tap - */ - tap( - interceptor: (value: T) => void, - thisArg?: any - ): TWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.tap - */ - tap( - interceptor: (value: T) => void, - thisArg?: any - ): TWrapper; - } - - //_.thru - interface LoDashStatic { - /** - * This method is like _.tap except that it returns the result of interceptor. - * - * @param value The value to provide to interceptor. - * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. - * @return Returns the result of interceptor. - */ - thru( - value: T, - interceptor: (value: T) => TResult, - thisArg?: any - ): TResult; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult, - thisArg?: any): LoDashImplicitWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult, - thisArg?: any): LoDashImplicitWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult, - thisArg?: any): LoDashImplicitWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult, - thisArg?: any): LoDashImplicitObjectWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult[], - thisArg?: any): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult, - thisArg?: any - ): LoDashExplicitObjectWrapper; - - /** - * @see _.thru - */ - thru( - interceptor: (value: T) => TResult[], - thisArg?: any - ): LoDashExplicitArrayWrapper; - } - - //_.prototype.commit - interface LoDashImplicitWrapperBase { - /** - * Executes the chained sequence and returns the wrapped result. - * - * @return Returns the new lodash wrapper instance. - */ - commit(): TWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.commit - */ - commit(): TWrapper; - } - - //_.prototype.concat - interface LoDashImplicitWrapperBase { - /** - * Creates a new array joining a wrapped array with any additional arrays and/or values. - * - * @param items - * @return Returns the new concatenated array. - */ - concat(...items: Array>): LoDashImplicitArrayWrapper; - - /** - * @see _.concat - */ - concat(...items: Array>): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.concat - */ - concat(...items: Array>): LoDashExplicitArrayWrapper; - - /** - * @see _.concat - */ - concat(...items: Array>): LoDashExplicitArrayWrapper; - } - - //_.prototype.plant - interface LoDashImplicitWrapperBase { - /** - * Creates a clone of the chained sequence planting value as the wrapped value. - * @param value The value to plant as the wrapped value. - * @return Returns the new lodash wrapper instance. - */ - plant(value: number): LoDashImplicitWrapper; - - /** - * @see _.plant - */ - plant(value: string): LoDashImplicitStringWrapper; - - /** - * @see _.plant - */ - plant(value: boolean): LoDashImplicitWrapper; - - /** - * @see _.plant - */ - plant(value: number[]): LoDashImplicitNumberArrayWrapper; - - /** - * @see _.plant - */ - plant(value: T[]): LoDashImplicitArrayWrapper; - - /** - * @see _.plant - */ - plant(value: T): LoDashImplicitObjectWrapper; - - /** - * @see _.plant - */ - plant(value: any): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.plant - */ - plant(value: number): LoDashExplicitWrapper; - - /** - * @see _.plant - */ - plant(value: string): LoDashExplicitStringWrapper; - - /** - * @see _.plant - */ - plant(value: boolean): LoDashExplicitWrapper; - - /** - * @see _.plant - */ - plant(value: number[]): LoDashExplicitNumberArrayWrapper; - - /** - * @see _.plant - */ - plant(value: T[]): LoDashExplicitArrayWrapper; - - /** - * @see _.plant - */ - plant(value: T): LoDashExplicitObjectWrapper; - - /** - * @see _.plant - */ - plant(value: any): LoDashExplicitWrapper; - } - - //_.prototype.reverse - interface LoDashImplicitArrayWrapper { - /** - * Reverses the wrapped array so the first element becomes the last, the second element becomes the second to - * last, and so on. - * - * Note: This method mutates the wrapped array. - * - * @return Returns the new reversed lodash wrapper instance. - */ - reverse(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.reverse - */ - reverse(): LoDashExplicitArrayWrapper; - } - - //_.prototype.toJSON - interface LoDashWrapperBase { - /** - * @see _.value - */ - toJSON(): T; - } - - //_.prototype.toString - interface LoDashWrapperBase { - /** - * Produces the result of coercing the unwrapped value to a string. - * - * @return Returns the coerced string value. - */ - toString(): string; - } - - //_.prototype.value - interface LoDashWrapperBase { - /** - * Executes the chained sequence to extract the unwrapped value. - * - * @alias _.toJSON, _.valueOf - * - * @return Returns the resolved unwrapped value. - */ - value(): T; - } - - //_.valueOf - interface LoDashWrapperBase { - /** - * @see _.value - */ - valueOf(): T; - } - - /************** - * Collection * - **************/ - - //_.at - interface LoDashStatic { - /** - * Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be - * specified as individual arguments or as arrays of keys. - * - * @param collection The collection to iterate over. - * @param props The property names or indexes of elements to pick, specified individually or in arrays. - * @return Returns the new array of picked elements. - */ - at( - collection: List|Dictionary, - ...props: (number|string|(number|string)[])[] - ): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.at - */ - at(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.at - */ - at(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.at - */ - at(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.at - */ - at(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper; - } - - //_.countBy - interface LoDashStatic { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - countBy( - collection: List, - iteratee?: ListIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: NumericDictionary, - iteratee?: NumericDictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: List|Dictionary|NumericDictionary, - iteratee?: string, - thisArg?: any - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: List|Dictionary|NumericDictionary, - iteratee?: W - ): Dictionary; - - /** - * @see _.countBy - */ - countBy( - collection: List|Dictionary|NumericDictionary, - iteratee?: Object - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.countBy - */ - countBy( - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.countBy - */ - countBy( - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: string, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: W - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.countBy - */ - countBy( - iteratee?: ListIterator|DictionaryIterator|NumericDictionaryIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: string, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: W - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.countBy - */ - countBy( - iteratee?: ListIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.countBy - */ - countBy( - iteratee?: ListIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: string, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: W - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.countBy - */ - countBy( - iteratee?: ListIterator|DictionaryIterator|NumericDictionaryIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: string, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.countBy - */ - countBy( - iteratee?: W - ): LoDashExplicitObjectWrapper>; - } - - //_.each - interface LoDashStatic { - /** - * @see _.forEach - */ - each( - collection: T[], - iteratee?: ListIterator, - thisArg?: any - ): T[]; - - /** - * @see _.forEach - */ - each( - collection: List, - iteratee?: ListIterator, - thisArg?: any - ): List; - - /** - * @see _.forEach - */ - each( - collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.forEach - */ - each( - collection: T, - iteratee?: ObjectIterator, - thisArgs?: any - ): T; - - /** - * @see _.forEach - */ - each( - collection: T, - iteratee?: ObjectIterator, - thisArgs?: any - ): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.forEach - */ - each( - iteratee: ListIterator, - thisArg?: any - ): LoDashImplicitWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.forEach - */ - each( - iteratee: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forEach - */ - each( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.forEach - */ - each( - iteratee: ListIterator, - thisArg?: any - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.forEach - */ - each( - iteratee: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forEach - */ - each( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper; - } - - //_.eachRight - interface LoDashStatic { - /** - * @see _.forEachRight - */ - eachRight( - collection: T[], - iteratee?: ListIterator, - thisArg?: any - ): T[]; - - /** - * @see _.forEachRight - */ - eachRight( - collection: List, - iteratee?: ListIterator, - thisArg?: any - ): List; - - /** - * @see _.forEachRight - */ - eachRight( - collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.forEachRight - */ - eachRight( - collection: T, - iteratee?: ObjectIterator, - thisArgs?: any - ): T; - - /** - * @see _.forEachRight - */ - eachRight( - collection: T, - iteratee?: ObjectIterator, - thisArgs?: any - ): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.forEachRight - */ - eachRight( - iteratee: ListIterator, - thisArg?: any - ): LoDashImplicitWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.forEachRight - */ - eachRight( - iteratee: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forEachRight - */ - eachRight( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.forEachRight - */ - eachRight( - iteratee: ListIterator, - thisArg?: any - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.forEachRight - */ - eachRight( - iteratee: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forEachRight - */ - eachRight( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper; - } - - //_.every - interface LoDashStatic { - /** - * Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate - * returns falsey. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if all elements pass the predicate check, else false. - */ - every( - collection: List, - predicate?: ListIterator - ): boolean; - - /** - * @see _.every - */ - every( - collection: Dictionary, - predicate?: DictionaryIterator - ): boolean; - - /** - * @see _.every - */ - every( - collection: NumericDictionary, - predicate?: NumericDictionaryIterator - ): boolean; - - /** - * @see _.every - */ - every( - collection: List|Dictionary|NumericDictionary, - predicate?: string|any[] - ): boolean; - - /** - * @see _.every - */ - every( - collection: List|Dictionary|NumericDictionary, - predicate?: TObject - ): boolean; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.every - */ - every( - predicate?: ListIterator|NumericDictionaryIterator - ): boolean; - - /** - * @see _.every - */ - every( - predicate?: string|any[] - ): boolean; - - /** - * @see _.every - */ - every( - predicate?: TObject - ): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.every - */ - every( - predicate?: ListIterator|DictionaryIterator|NumericDictionaryIterator - ): boolean; - - /** - * @see _.every - */ - every( - predicate?: string|any[] - ): boolean; - - /** - * @see _.every - */ - every( - predicate?: TObject - ): boolean; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.every - */ - every( - predicate?: ListIterator|NumericDictionaryIterator - ): LoDashExplicitWrapper; - - /** - * @see _.every - */ - every( - predicate?: string|any[] - ): LoDashExplicitWrapper; - - /** - * @see _.every - */ - every( - predicate?: TObject - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.every - */ - every( - predicate?: ListIterator|DictionaryIterator|NumericDictionaryIterator - ): LoDashExplicitWrapper; - - /** - * @see _.every - */ - every( - predicate?: string|any[] - ): LoDashExplicitWrapper; - - /** - * @see _.every - */ - every( - predicate?: TObject - ): LoDashExplicitWrapper; - } - - //_.filter - interface LoDashStatic { - /** - * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - filter( - collection: List, - predicate?: ListIterator, - thisArg?: any - ): T[]; - - /** - * @see _.filter - */ - filter( - collection: Dictionary, - predicate?: DictionaryIterator, - thisArg?: any - ): T[]; - - /** - * @see _.filter - */ - filter( - collection: string, - predicate?: StringIterator, - thisArg?: any - ): string[]; - - /** - * @see _.filter - */ - filter( - collection: List|Dictionary, - predicate: string, - thisArg?: any - ): T[]; - - /** - * @see _.filter - */ - filter( - collection: List|Dictionary, - predicate: W - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.filter - */ - filter( - predicate?: StringIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.filter - */ - filter( - predicate: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - */ - filter( - predicate: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - */ - filter(predicate: W): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.filter - */ - filter( - predicate: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - */ - filter( - predicate: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - */ - filter(predicate: W): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.filter - */ - filter( - predicate?: StringIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.filter - */ - filter( - predicate: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.filter - */ - filter( - predicate: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.filter - */ - filter(predicate: W): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.filter - */ - filter( - predicate: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.filter - */ - filter( - predicate: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.filter - */ - filter(predicate: W): LoDashExplicitArrayWrapper; - } - - //_.find - interface LoDashStatic { - /** - * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the matched element, else undefined. - */ - find( - collection: List, - predicate?: ListIterator, - thisArg?: any - ): T; - - /** - * @see _.find - */ - find( - collection: Dictionary, - predicate?: DictionaryIterator, - thisArg?: any - ): T; - - /** - * @see _.find - */ - find( - collection: List|Dictionary, - predicate?: string, - thisArg?: any - ): T; - - /** - * @see _.find - */ - find( - collection: List|Dictionary, - predicate?: TObject - ): T; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.find - */ - find( - predicate?: ListIterator, - thisArg?: any - ): T; - - /** - * @see _.find - */ - find( - predicate?: string, - thisArg?: any - ): T; - - /** - * @see _.find - */ - find( - predicate?: TObject - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.find - */ - find( - predicate?: ListIterator|DictionaryIterator, - thisArg?: any - ): TResult; - - /** - * @see _.find - */ - find( - predicate?: string, - thisArg?: any - ): TResult; - - /** - * @see _.find - */ - find( - predicate?: TObject - ): TResult; - } - - //_.findLast - interface LoDashStatic { - /** - * This method is like _.find except that it iterates over elements of a collection from - * right to left. - * @param collection Searches for a value in this list. - * @param callback The function called per iteration. - * @param thisArg The this binding of callback. - * @return The found element, else undefined. - **/ - findLast( - collection: Array, - callback: ListIterator, - thisArg?: any): T; - - /** - * @see _.find - **/ - findLast( - collection: List, - callback: ListIterator, - thisArg?: any): T; - - /** - * @see _.find - **/ - findLast( - collection: Dictionary, - callback: DictionaryIterator, - thisArg?: any): T; - - /** - * @see _.find - * @param _.pluck style callback - **/ - findLast( - collection: Array, - whereValue: W): T; - - /** - * @see _.find - * @param _.pluck style callback - **/ - findLast( - collection: List, - whereValue: W): T; - - /** - * @see _.find - * @param _.pluck style callback - **/ - findLast( - collection: Dictionary, - whereValue: W): T; - - /** - * @see _.find - * @param _.where style callback - **/ - findLast( - collection: Array, - pluckValue: string): T; - - /** - * @see _.find - * @param _.where style callback - **/ - findLast( - collection: List, - pluckValue: string): T; - - /** - * @see _.find - * @param _.where style callback - **/ - findLast( - collection: Dictionary, - pluckValue: string): T; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.findLast - */ - findLast( - callback: ListIterator, - thisArg?: any): T; - /** - * @see _.findLast - * @param _.where style callback - */ - findLast( - whereValue: W): T; - - /** - * @see _.findLast - * @param _.where style callback - */ - findLast( - pluckValue: string): T; - } - - //_.flatMap - interface LoDashStatic { - /** - * Creates an array of flattened values by running each element in collection through iteratee - * and concating its result to the other mapped values. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @return Returns the new flattened array. - */ - flatMap( - collection: List, - iteratee?: ListIterator - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: List, - iteratee?: ListIterator - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: Dictionary, - iteratee?: DictionaryIterator - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: Dictionary, - iteratee?: DictionaryIterator - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: NumericDictionary, - iteratee?: NumericDictionaryIterator - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: NumericDictionary, - iteratee?: NumericDictionaryIterator - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: TObject, - iteratee?: ObjectIterator - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: Object, - iteratee?: ObjectIterator - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: TObject, - iteratee: TWhere - ): boolean[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: TObject, - iteratee: Object|string - ): TResult[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: TObject, - iteratee: [string, any] - ): boolean[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: string - ): string[]; - - /** - * @see _.flatMap - */ - flatMap( - collection: Object, - iteratee?: Object|string - ): TResult[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.flatMap - */ - flatMap( - iteratee: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.flatMap - */ - flatMap( - iteratee: ListIterator|string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: TWhere - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: [string, any] - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.flatMap - */ - flatMap( - iteratee: ListIterator|DictionaryIterator|NumericDictionaryIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: ObjectIterator|string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: TWhere - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: [string, any] - ): LoDashImplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.flatMap - */ - flatMap( - iteratee: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.flatMap - */ - flatMap( - iteratee: ListIterator|string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: TWhere - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: [string, any] - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.flatMap - */ - flatMap( - iteratee: ListIterator|DictionaryIterator|NumericDictionaryIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: ObjectIterator|string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: TWhere - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap( - iteratee: [string, any] - ): LoDashExplicitArrayWrapper; - - /** - * @see _.flatMap - */ - flatMap(): LoDashExplicitArrayWrapper; - } - - //_.forEach - interface LoDashStatic { - /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. - * - * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To - * avoid this behavior _.forIn or _.forOwn may be used for object iteration. - * - * @alias _.each - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - */ - forEach( - collection: T[], - iteratee?: ListIterator, - thisArg?: any - ): T[]; - - /** - * @see _.forEach - */ - forEach( - collection: List, - iteratee?: ListIterator, - thisArg?: any - ): List; - - /** - * @see _.forEach - */ - forEach( - collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.forEach - */ - forEach( - collection: T, - iteratee?: ObjectIterator, - thisArgs?: any - ): T; - - /** - * @see _.forEach - */ - forEach( - collection: T, - iteratee?: ObjectIterator, - thisArgs?: any - ): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.forEach - */ - forEach( - iteratee: ListIterator, - thisArg?: any - ): LoDashImplicitWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.forEach - */ - forEach( - iteratee: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forEach - */ - forEach( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.forEach - */ - forEach( - iteratee: ListIterator, - thisArg?: any - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.forEach - */ - forEach( - iteratee: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forEach - */ - forEach( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper; - } - - //_.forEachRight - interface LoDashStatic { - /** - * This method is like _.forEach except that it iterates over elements of collection from right to left. - * - * @alias _.eachRight - * - * @param collection The collection to iterate over. - * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. - */ - forEachRight( - collection: T[], - iteratee?: ListIterator, - thisArg?: any - ): T[]; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: List, - iteratee?: ListIterator, - thisArg?: any - ): List; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: T, - iteratee?: ObjectIterator, - thisArgs?: any - ): T; - - /** - * @see _.forEachRight - */ - forEachRight( - collection: T, - iteratee?: ObjectIterator, - thisArgs?: any - ): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.forEachRight - */ - forEachRight( - iteratee: ListIterator, - thisArg?: any - ): LoDashImplicitWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.forEachRight - */ - forEachRight( - iteratee: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forEachRight - */ - forEachRight( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.forEachRight - */ - forEachRight( - iteratee: ListIterator, - thisArg?: any - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.forEachRight - */ - forEachRight( - iteratee: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forEachRight - */ - forEachRight( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper; - } - - //_.groupBy - interface LoDashStatic { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - groupBy( - collection: List, - iteratee?: ListIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: List, - iteratee?: ListIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: List|Dictionary, - iteratee?: string, - thisArg?: TValue - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: List|Dictionary, - iteratee?: string, - thisArg?: any - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: List|Dictionary, - iteratee?: TWhere - ): Dictionary; - - /** - * @see _.groupBy - */ - groupBy( - collection: List|Dictionary, - iteratee?: Object - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: string, - thisArg?: TValue - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: TWhere - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: string, - thisArg?: TValue - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: string, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: TWhere - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: Object - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: string, - thisArg?: TValue - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: TWhere - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: string, - thisArg?: TValue - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: string, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: TWhere - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.groupBy - */ - groupBy( - iteratee?: Object - ): LoDashExplicitObjectWrapper>; - } - - //_.includes - interface LoDashStatic { - /** - * Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative, - * it’s used as the offset from the end of collection. - * - * @param collection The collection to search. - * @param target The value to search for. - * @param fromIndex The index to search from. - * @return True if the target element is found, else false. - */ - includes( - collection: List|Dictionary, - target: T, - fromIndex?: number - ): boolean; - - /** - * @see _.includes - */ - includes( - collection: string, - target: string, - fromIndex?: number - ): boolean; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.includes - */ - includes( - target: T, - fromIndex?: number - ): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.includes - */ - includes( - target: TValue, - fromIndex?: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.includes - */ - includes( - target: string, - fromIndex?: number - ): boolean; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.includes - */ - includes( - target: T, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.includes - */ - includes( - target: TValue, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.includes - */ - includes( - target: string, - fromIndex?: number - ): LoDashExplicitWrapper; - } - - //_.keyBy - interface LoDashStatic { - /** - * Creates an object composed of keys generated from the results of running each element of collection through - * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the composed aggregate object. - */ - keyBy( - collection: List, - iteratee?: ListIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: NumericDictionary, - iteratee?: NumericDictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: List|NumericDictionary|Dictionary, - iteratee?: string, - thisArg?: any - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: List|NumericDictionary|Dictionary, - iteratee?: W - ): Dictionary; - - /** - * @see _.keyBy - */ - keyBy( - collection: List|NumericDictionary|Dictionary, - iteratee?: Object - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.keyBy - */ - keyBy( - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.keyBy - */ - keyBy( - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: string, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: W - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.keyBy - */ - keyBy( - iteratee?: ListIterator|NumericDictionaryIterator|DictionaryIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: string, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: W - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: Object - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.keyBy - */ - keyBy( - iteratee?: ListIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.keyBy - */ - keyBy( - iteratee?: ListIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: string, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: W - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.keyBy - */ - keyBy( - iteratee?: ListIterator|NumericDictionaryIterator|DictionaryIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: string, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: W - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.keyBy - */ - keyBy( - iteratee?: Object - ): LoDashExplicitObjectWrapper>; - } - - //_.invoke - interface LoDashStatic { - /** - * Invokes the method at path of object. - * @param object The object to query. - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - **/ - invoke( - object: TObject, - path: StringRepresentable|StringRepresentable[], - ...args: any[]): TResult; - - /** - * @see _.invoke - **/ - invoke( - object: Dictionary|TValue[], - path: StringRepresentable|StringRepresentable[], - ...args: any[]): TResult; - - /** - * @see _.invoke - **/ - invoke( - object: any, - path: StringRepresentable|StringRepresentable[], - ...args: any[]): TResult; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.invoke - **/ - invoke( - path: StringRepresentable|StringRepresentable[], - ...args: any[]): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.invoke - **/ - invoke( - path: StringRepresentable|StringRepresentable[], - ...args: any[]): TResult; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.invoke - **/ - invoke( - path: StringRepresentable|StringRepresentable[], - ...args: any[]): TResult; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.invoke - **/ - invoke( - path: StringRepresentable|StringRepresentable[], - ...args: any[]): TResult; - } - - //_.invokeMap - interface LoDashStatic { - /** - * Invokes the method named by methodName on each element in the collection returning - * an array of the results of each invoked method. Additional arguments will be provided - * to each invoked method. If methodName is a function it will be invoked for, and this - * bound to, each element in the collection. - * @param collection The collection to iterate over. - * @param methodName The name of the method to invoke. - * @param args Arguments to invoke the method with. - **/ - invokeMap( - collection: TValue[], - methodName: string, - ...args: any[]): TResult[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: Dictionary, - methodName: string, - ...args: any[]): TResult[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: {}[], - methodName: string, - ...args: any[]): TResult[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: Dictionary<{}>, - methodName: string, - ...args: any[]): TResult[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: TValue[], - method: (...args: any[]) => TResult, - ...args: any[]): TResult[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: Dictionary, - method: (...args: any[]) => TResult, - ...args: any[]): TResult[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: {}[], - method: (...args: any[]) => TResult, - ...args: any[]): TResult[]; - - /** - * @see _.invokeMap - **/ - invokeMap( - collection: Dictionary<{}>, - method: (...args: any[]) => TResult, - ...args: any[]): TResult[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.invokeMap - **/ - invokeMap( - methodName: string, - ...args: any[]): LoDashImplicitArrayWrapper; - - /** - * @see _.invokeMap - **/ - invokeMap( - method: (...args: any[]) => TResult, - ...args: any[]): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.invokeMap - **/ - invokeMap( - methodName: string, - ...args: any[]): LoDashImplicitArrayWrapper; - - /** - * @see _.invokeMap - **/ - invokeMap( - method: (...args: any[]) => TResult, - ...args: any[]): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.invokeMap - **/ - invokeMap( - methodName: string, - ...args: any[]): LoDashExplicitArrayWrapper; - - /** - * @see _.invokeMap - **/ - invokeMap( - method: (...args: any[]) => TResult, - ...args: any[]): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.invokeMap - **/ - invokeMap( - methodName: string, - ...args: any[]): LoDashExplicitArrayWrapper; - - /** - * @see _.invokeMap - **/ - invokeMap( - method: (...args: any[]) => TResult, - ...args: any[]): LoDashExplicitArrayWrapper; - } - - //_.map - interface LoDashStatic { - /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, - * _.reject, and _.some. - * - * The guarded methods are: - * ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max, - * min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range, - * sample, some, sum, uniq, and words - * - * @param collection The collection to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped array. - */ - map( - collection: List, - iteratee?: ListIterator, - thisArg?: any - ): TResult[]; - - /** - * @see _.map - */ - map( - collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any - ): TResult[]; - - map( - collection: NumericDictionary, - iteratee?: NumericDictionaryIterator, - thisArg?: any - ): TResult[]; - - /** - * @see _.map - */ - map( - collection: List|Dictionary|NumericDictionary, - iteratee?: string - ): TResult[]; - - /** - * @see _.map - */ - map( - collection: List|Dictionary|NumericDictionary, - iteratee?: TObject - ): boolean[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.map - */ - map( - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: TObject - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.map - */ - map( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: string - ): LoDashImplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: TObject - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.map - */ - map( - iteratee?: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: TObject - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.map - */ - map( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: string - ): LoDashExplicitArrayWrapper; - - /** - * @see _.map - */ - map( - iteratee?: TObject - ): LoDashExplicitArrayWrapper; - } - - //_.partition - interface LoDashStatic { - /** - * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, - * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. - * - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the array of grouped elements. - **/ - partition( - collection: List, - callback: ListIterator, - thisArg?: any): T[][]; - - /** - * @see _.partition - **/ - partition( - collection: Dictionary, - callback: DictionaryIterator, - thisArg?: any): T[][]; - - /** - * @see _.partition - **/ - partition( - collection: List, - whereValue: W): T[][]; - - /** - * @see _.partition - **/ - partition( - collection: Dictionary, - whereValue: W): T[][]; - - /** - * @see _.partition - **/ - partition( - collection: List, - path: string, - srcValue: any): T[][]; - - /** - * @see _.partition - **/ - partition( - collection: Dictionary, - path: string, - srcValue: any): T[][]; - - /** - * @see _.partition - **/ - partition( - collection: List, - pluckValue: string): T[][]; - - /** - * @see _.partition - **/ - partition( - collection: Dictionary, - pluckValue: string): T[][]; - } - - interface LoDashImplicitStringWrapper { - /** - * @see _.partition - */ - partition( - callback: ListIterator, - thisArg?: any): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.partition - */ - partition( - callback: ListIterator, - thisArg?: any): LoDashImplicitArrayWrapper; - /** - * @see _.partition - */ - partition( - whereValue: W): LoDashImplicitArrayWrapper; - /** - * @see _.partition - */ - partition( - path: string, - srcValue: any): LoDashImplicitArrayWrapper; - /** - * @see _.partition - */ - partition( - pluckValue: string): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.partition - */ - partition( - callback: ListIterator, - thisArg?: any): LoDashImplicitArrayWrapper; - - /** - * @see _.partition - */ - partition( - callback: DictionaryIterator, - thisArg?: any): LoDashImplicitArrayWrapper; - - /** - * @see _.partition - */ - partition( - whereValue: W): LoDashImplicitArrayWrapper; - - /** - * @see _.partition - */ - partition( - path: string, - srcValue: any): LoDashImplicitArrayWrapper; - - /** - * @see _.partition - */ - partition( - pluckValue: string): LoDashImplicitArrayWrapper; - } - - //_.reduce - interface LoDashStatic { - /** - * Reduces a collection to a value which is the accumulated result of running each - * element in the collection through the callback, where each successive callback execution - * consumes the return value of the previous execution. If accumulator is not provided the - * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @param thisArg The this binding of callback. - * @return Returns the accumulated value. - **/ - reduce( - collection: Array, - callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: List, - callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: Dictionary, - callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: NumericDictionary, - callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: Array, - callback: MemoIterator, - thisArg?: any): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: List, - callback: MemoIterator, - thisArg?: any): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: Dictionary, - callback: MemoIterator, - thisArg?: any): TResult; - - /** - * @see _.reduce - **/ - reduce( - collection: NumericDictionary, - callback: MemoIterator, - thisArg?: any): TResult; - - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.reduce - **/ - reduce( - callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; - - /** - * @see _.reduce - **/ - reduce( - callback: MemoIterator, - thisArg?: any): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.reduce - **/ - reduce( - callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; - - /** - * @see _.reduce - **/ - reduce( - callback: MemoIterator, - thisArg?: any): TResult; - } - - //_.reduceRight - interface LoDashStatic { - /** - * This method is like _.reduce except that it iterates over elements of a collection from - * right to left. - * @param collection The collection to iterate over. - * @param callback The function called per iteration. - * @param accumulator Initial value of the accumulator. - * @param thisArg The this binding of callback. - * @return The accumulated value. - **/ - reduceRight( - collection: Array, - callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: List, - callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: Dictionary, - callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: Array, - callback: MemoIterator, - thisArg?: any): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: List, - callback: MemoIterator, - thisArg?: any): TResult; - - /** - * @see _.reduceRight - **/ - reduceRight( - collection: Dictionary, - callback: MemoIterator, - thisArg?: any): TResult; - } - - //_.reject - interface LoDashStatic { - /** - * The opposite of _.filter; this method returns the elements of collection that predicate does not return - * truthy for. - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the new filtered array. - */ - reject( - collection: List, - predicate?: ListIterator, - thisArg?: any - ): T[]; - - /** - * @see _.reject - */ - reject( - collection: Dictionary, - predicate?: DictionaryIterator, - thisArg?: any - ): T[]; - - /** - * @see _.reject - */ - reject( - collection: string, - predicate?: StringIterator, - thisArg?: any - ): string[]; - - /** - * @see _.reject - */ - reject( - collection: List|Dictionary, - predicate: string, - thisArg?: any - ): T[]; - - /** - * @see _.reject - */ - reject( - collection: List|Dictionary, - predicate: W - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.reject - */ - reject( - predicate?: StringIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.reject - */ - reject( - predicate: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.reject - */ - reject( - predicate: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.reject - */ - reject(predicate: W): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.reject - */ - reject( - predicate: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.reject - */ - reject( - predicate: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.reject - */ - reject(predicate: W): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.reject - */ - reject( - predicate?: StringIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.reject - */ - reject( - predicate: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.reject - */ - reject( - predicate: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.reject - */ - reject(predicate: W): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.reject - */ - reject( - predicate: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.reject - */ - reject( - predicate: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.reject - */ - reject(predicate: W): LoDashExplicitArrayWrapper; - } - - //_.sample - interface LoDashStatic { - /** - * Gets a random element from collection. - * - * @param collection The collection to sample. - * @return Returns the random element. - */ - sample( - collection: List|Dictionary|NumericDictionary - ): T; - - /** - * @see _.sample - */ - sample( - collection: O - ): T; - - /** - * @see _.sample - */ - sample( - collection: Object - ): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sample - */ - sample(): string; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sample - */ - sample(): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sample - */ - sample(): T; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sample - */ - sample(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sample - */ - sample(): TWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sample - */ - sample(): TWrapper; - } - - //_.sampleSize - interface LoDashStatic { - /** - * Gets n random elements at unique keys from collection up to the size of collection. - * - * @param collection The collection to sample. - * @param n The number of elements to sample. - * @return Returns the random elements. - */ - sampleSize( - collection: List|Dictionary|NumericDictionary, - n?: number - ): T[]; - - /** - * @see _.sampleSize - */ - sampleSize( - collection: O, - n?: number - ): T[]; - - /** - * @see _.sampleSize - */ - sampleSize( - collection: Object, - n?: number - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - n?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - n?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - n?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - n?: number - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - n?: number - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sampleSize - */ - sampleSize( - n?: number - ): LoDashExplicitArrayWrapper; - } - - //_.shuffle - interface LoDashStatic { - /** - * Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. - * - * @param collection The collection to shuffle. - * @return Returns the new shuffled array. - */ - shuffle(collection: List|Dictionary): T[]; - - /** - * @see _.shuffle - */ - shuffle(collection: string): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.shuffle - */ - shuffle(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.shuffle - */ - shuffle(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.shuffle - */ - shuffle(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.shuffle - */ - shuffle(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.shuffle - */ - shuffle(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.shuffle - */ - shuffle(): LoDashExplicitArrayWrapper; - } - - //_.size - interface LoDashStatic { - /** - * Gets the size of collection by returning its length for array-like values or the number of own enumerable - * properties for objects. - * - * @param collection The collection to inspect. - * @return Returns the size of collection. - */ - size(collection: List|Dictionary): number; - - /** - * @see _.size - */ - size(collection: string): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.size - */ - size(): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.size - */ - size(): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.size - */ - size(): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.size - */ - size(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.size - */ - size(): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.size - */ - size(): LoDashExplicitWrapper; - } - - //_.some - interface LoDashStatic { - /** - * Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate - * returns truthy. The predicate is invoked with three arguments: (value, index|key, collection). - * - * @param collection The collection to iterate over. - * @param predicate The function invoked per iteration. - * @return Returns true if any element passes the predicate check, else false. - */ - some( - collection: List, - predicate?: ListIterator - ): boolean; - - /** - * @see _.some - */ - some( - collection: Dictionary, - predicate?: DictionaryIterator - ): boolean; - - /** - * @see _.some - */ - some( - collection: NumericDictionary, - predicate?: NumericDictionaryIterator - ): boolean; - - /** - * @see _.some - */ - some( - collection: Object, - predicate?: ObjectIterator - ): boolean; - - /** - * @see _.some - */ - some( - collection: List|Dictionary|NumericDictionary, - predicate?: string|[string, any] - ): boolean; - - - /** - * @see _.some - */ - some( - collection: Object, - predicate?: string|[string, any] - ): boolean; - - /** - * @see _.some - */ - some( - collection: List|Dictionary|NumericDictionary, - predicate?: TObject - ): boolean; - - /** - * @see _.some - */ - some( - collection: List|Dictionary|NumericDictionary, - predicate?: Object - ): boolean; - - /** - * @see _.some - */ - some( - collection: Object, - predicate?: TObject - ): boolean; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.some - */ - some( - predicate?: ListIterator|NumericDictionaryIterator - ): boolean; - - /** - * @see _.some - */ - some( - predicate?: string|[string, any] - ): boolean; - - /** - * @see _.some - */ - some( - predicate?: TObject - ): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.some - */ - some( - predicate?: ListIterator|DictionaryIterator|NumericDictionaryIterator|ObjectIterator - ): boolean; - - /** - * @see _.some - */ - some( - predicate?: string|[string, any] - ): boolean; - - /** - * @see _.some - */ - some( - predicate?: TObject - ): boolean; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.some - */ - some( - predicate?: ListIterator|NumericDictionaryIterator - ): LoDashExplicitWrapper; - - /** - * @see _.some - */ - some( - predicate?: string|[string, any] - ): LoDashExplicitWrapper; - - /** - * @see _.some - */ - some( - predicate?: TObject - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.some - */ - some( - predicate?: ListIterator|DictionaryIterator|NumericDictionaryIterator|ObjectIterator - ): LoDashExplicitWrapper; - - /** - * @see _.some - */ - some( - predicate?: string|[string, any] - ): LoDashExplicitWrapper; - - /** - * @see _.some - */ - some( - predicate?: TObject - ): LoDashExplicitWrapper; - } - - //_.sortBy - interface LoDashStatic { - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[]|Object|Object[]|string|string[])} [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - sortBy( - collection: List, - iteratee?: ListIterator - ): T[]; - - /** - * @see _.sortBy - */ - sortBy( - collection: Dictionary, - iteratee?: DictionaryIterator - ): T[]; - - /** - * @see _.sortBy - */ - sortBy( - collection: List|Dictionary, - iteratee: string - ): T[]; - - /** - * @see _.sortBy - */ - sortBy( - collection: List|Dictionary, - whereValue: W - ): T[]; - - /** - * @see _.sortBy - */ - sortBy( - collection: List|Dictionary - ): T[]; - - /** - * @see _.sortBy - */ - sortBy( - collection: (Array|List), - iteratees: (ListIterator|string|Object)[]): T[]; - - /** - * @see _.sortBy - */ - sortBy( - collection: (Array|List), - ...iteratees: (ListIterator|Object|string)[]): T[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sortBy - */ - sortBy( - iteratee?: ListIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(iteratee: string): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(whereValue: W): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(...iteratees: (ListIterator|Object|string)[]): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - **/ - sortBy(iteratees: (ListIterator|string|Object)[]): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sortBy - */ - sortBy( - iteratee?: ListIterator|DictionaryIterator - ): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(iteratee: string): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(whereValue: W): LoDashImplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sortBy - */ - sortBy( - iteratee?: ListIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(iteratee: string): LoDashExplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(whereValue: W): LoDashExplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sortBy - */ - sortBy( - iteratee?: ListIterator|DictionaryIterator - ): LoDashExplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(iteratee: string): LoDashExplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(whereValue: W): LoDashExplicitArrayWrapper; - - /** - * @see _.sortBy - */ - sortBy(): LoDashExplicitArrayWrapper; - } - - //_.orderBy - interface LoDashStatic { - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} [iteratees=[_.identity]] The iteratees to sort by. - * @param {string[]} [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - orderBy( - collection: List, - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: List, - iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: NumericDictionary, - iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: NumericDictionary, - iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: Dictionary, - iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] - ): T[]; - - /** - * @see _.orderBy - */ - orderBy( - collection: Dictionary, - iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.orderBy - */ - orderBy( - iteratees: ListIterator|string|(ListIterator|string)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.orderBy - */ - orderBy( - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.orderBy - */ - orderBy( - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashImplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashImplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashImplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashImplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashImplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.orderBy - */ - orderBy( - iteratees: ListIterator|string|(ListIterator|string)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.orderBy - */ - orderBy( - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.orderBy - */ - orderBy( - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashExplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashExplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashExplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashExplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashExplicitArrayWrapper; - - /** - * @see _.orderBy - */ - orderBy( - iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] - ): LoDashExplicitArrayWrapper; - } - - /******** - * Date * - ********/ - - //_.now - interface LoDashStatic { - /** - * Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @return The number of milliseconds. - */ - now(): number; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.now - */ - now(): number; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.now - */ - now(): LoDashExplicitWrapper; - } - - /************* - * Functions * - *************/ - - //_.after - interface LoDashStatic { - /** - * The opposite of _.before; this method creates a function that invokes func once it’s called n or more times. - * - * @param n The number of calls before func is invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - after( - n: number, - func: TFunc - ): TFunc; - } - - interface LoDashImplicitWrapper { - /** - * @see _.after - **/ - after(func: TFunc): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.after - **/ - after(func: TFunc): LoDashExplicitObjectWrapper; - } - - //_.ary - interface LoDashStatic { - /** - * Creates a function that accepts up to n arguments ignoring any additional arguments. - * - * @param func The function to cap arguments for. - * @param n The arity cap. - * @returns Returns the new function. - */ - ary( - func: Function, - n?: number - ): TResult; - - ary( - func: T, - n?: number - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.ary - */ - ary(n?: number): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.ary - */ - ary(n?: number): LoDashExplicitObjectWrapper; - } - - //_.before - interface LoDashStatic { - /** - * Creates a function that invokes func, with the this binding and arguments of the created function, while - * it’s called less than n times. Subsequent calls to the created function return the result of the last func - * invocation. - * - * @param n The number of calls at which func is no longer invoked. - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - before( - n: number, - func: TFunc - ): TFunc; - } - - interface LoDashImplicitWrapper { - /** - * @see _.before - **/ - before(func: TFunc): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.before - **/ - before(func: TFunc): LoDashExplicitObjectWrapper; - } - - //_.bind - interface FunctionBind { - placeholder: any; - - ( - func: T, - thisArg: any, - ...partials: any[] - ): TResult; - - ( - func: Function, - thisArg: any, - ...partials: any[] - ): TResult; - } - - interface LoDashStatic { - /** - * Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind - * arguments to those provided to the bound function. - * - * The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for - * partially applied arguments. - * - * Note: Unlike native Function#bind this method does not set the "length" property of bound functions. - * - * @param func The function to bind. - * @param thisArg The this binding of func. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - bind: FunctionBind; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.bind - */ - bind( - thisArg: any, - ...partials: any[] - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.bind - */ - bind( - thisArg: any, - ...partials: any[] - ): LoDashExplicitObjectWrapper; - } - - //_.bindAll - interface LoDashStatic { - /** - * Binds methods of an object to the object itself, overwriting the existing method. Method names may be - * specified as individual arguments or as arrays of method names. If no method names are provided all - * enumerable function properties, own and inherited, of object are bound. - * - * Note: This method does not set the "length" property of bound functions. - * - * @param object The object to bind and assign the bound methods to. - * @param methodNames The object method names to bind, specified as individual method names or arrays of - * method names. - * @return Returns object. - */ - bindAll( - object: T, - ...methodNames: (string|string[])[] - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.bindAll - */ - bindAll(...methodNames: (string|string[])[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.bindAll - */ - bindAll(...methodNames: (string|string[])[]): LoDashExplicitObjectWrapper; - } - - //_.bindKey - interface FunctionBindKey { - placeholder: any; - - ( - object: T, - key: any, - ...partials: any[] - ): TResult; - - ( - object: Object, - key: any, - ...partials: any[] - ): TResult; - } - - interface LoDashStatic { - /** - * Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments - * to those provided to the bound function. - * - * This method differs from _.bind by allowing bound functions to reference methods that may be redefined - * or don’t yet exist. See Peter Michaux’s article for more details. - * - * The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder - * for partially applied arguments. - * - * @param object The object the method belongs to. - * @param key The key of the method. - * @param partials The arguments to be partially applied. - * @return Returns the new bound function. - */ - bindKey: FunctionBindKey; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.bindKey - */ - bindKey( - key: any, - ...partials: any[] - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.bindKey - */ - bindKey( - key: any, - ...partials: any[] - ): LoDashExplicitObjectWrapper; - } - - //_.createCallback - interface LoDashStatic { - /** - * Produces a callback bound to an optional thisArg. If func is a property name the created - * callback will return the property value for a given element. If func is an object the created - * callback will return true for elements that contain the equivalent object properties, - * otherwise it will return false. - * @param func The value to convert to a callback. - * @param thisArg The this binding of the created callback. - * @param argCount The number of arguments the callback accepts. - * @return A callback function. - **/ - createCallback( - func: string, - thisArg?: any, - argCount?: number): () => any; - - /** - * @see _.createCallback - **/ - createCallback( - func: Dictionary, - thisArg?: any, - argCount?: number): () => boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.createCallback - **/ - createCallback( - thisArg?: any, - argCount?: number): LoDashImplicitObjectWrapper<() => any>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.createCallback - **/ - createCallback( - thisArg?: any, - argCount?: number): LoDashImplicitObjectWrapper<() => any>; - } - - //_.curry - interface LoDashStatic { - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curry(func: (t1: T1) => R): - CurriedFunction1; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2) => R): - CurriedFunction2; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2, t3: T3) => R): - CurriedFunction3; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): - CurriedFunction4; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curry(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): - CurriedFunction5; - /** - * Creates a function that accepts one or more arguments of func that when called either invokes func returning - * its result, if all func arguments have been provided, or returns a function that accepts one or more of the - * remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curry( - func: Function, - arity?: number): TResult; - } - - interface CurriedFunction1 { - (): CurriedFunction1; - (t1: T1): R; - } - - interface CurriedFunction2 { - (): CurriedFunction2; - (t1: T1): CurriedFunction1; - (t1: T1, t2: T2): R; - } - - interface CurriedFunction3 { - (): CurriedFunction3; - (t1: T1): CurriedFunction2; - (t1: T1, t2: T2): CurriedFunction1; - (t1: T1, t2: T2, t3: T3): R; - } - - interface CurriedFunction4 { - (): CurriedFunction4; - (t1: T1): CurriedFunction3; - (t1: T1, t2: T2): CurriedFunction2; - (t1: T1, t2: T2, t3: T3): CurriedFunction1; - (t1: T1, t2: T2, t3: T3, t4: T4): R; - } - - interface CurriedFunction5 { - (): CurriedFunction5; - (t1: T1): CurriedFunction4; - (t1: T1, t2: T2): CurriedFunction3; - (t1: T1, t2: T2, t3: T3): CurriedFunction2; - (t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1; - (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.curry - **/ - curry(arity?: number): LoDashImplicitObjectWrapper; - } - - //_.curryRight - interface LoDashStatic { - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1) => R): - CurriedFunction1; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2) => R): - CurriedFunction2; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2, t3: T3) => R): - CurriedFunction3; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R): - CurriedFunction4; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @return Returns the new curried function. - */ - curryRight(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R): - CurriedFunction5; - /** - * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight - * instead of _.partial. - * @param func The function to curry. - * @param arity The arity of func. - * @return Returns the new curried function. - */ - curryRight( - func: Function, - arity?: number): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.curryRight - **/ - curryRight(arity?: number): LoDashImplicitObjectWrapper; - } - - //_.debounce - interface DebounceSettings { - /** - * Specify invoking on the leading edge of the timeout. - */ - leading?: boolean; - - /** - * The maximum time func is allowed to be delayed before it’s invoked. - */ - maxWait?: number; - - /** - * Specify invoking on the trailing edge of the timeout. - */ - trailing?: boolean; - } - - interface LoDashStatic { - /** - * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since - * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations. Provide an options object to indicate that func should be invoked on the - * leading and/or trailing edge of the wait timeout. Subsequent calls to the debounced function return the - * result of the last func invocation. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only - * if the the debounced function is invoked more than once during the wait timeout. - * - * See David Corbacho’s article for details over the differences between _.debounce and _.throttle. - * - * @param func The function to debounce. - * @param wait The number of milliseconds to delay. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new debounced function. - */ - debounce( - func: T, - wait?: number, - options?: DebounceSettings - ): T & Cancelable; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.debounce - */ - debounce( - wait?: number, - options?: DebounceSettings - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.debounce - */ - debounce( - wait?: number, - options?: DebounceSettings - ): LoDashExplicitObjectWrapper; - } - - //_.defer - interface LoDashStatic { - /** - * Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to - * func when it’s invoked. - * - * @param func The function to defer. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - defer( - func: T, - ...args: any[] - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.defer - */ - defer(...args: any[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.defer - */ - defer(...args: any[]): LoDashExplicitWrapper; - } - - //_.delay - interface LoDashStatic { - /** - * Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked. - * - * @param func The function to delay. - * @param wait The number of milliseconds to delay invocation. - * @param args The arguments to invoke the function with. - * @return Returns the timer id. - */ - delay( - func: T, - wait: number, - ...args: any[] - ): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.delay - */ - delay( - wait: number, - ...args: any[] - ): LoDashImplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.delay - */ - delay( - wait: number, - ...args: any[] - ): LoDashExplicitWrapper; - } - - interface LoDashStatic { - /** - * Creates a function that invokes `func` with arguments reversed. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to flip arguments for. - * @returns {Function} Returns the new function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ - flip(func: T): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.flip - */ - flip(): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.flip - */ - flip(): LoDashExplicitObjectWrapper; - } - - //_.flow - interface LoDashStatic { - /** - * Creates a function that returns the result of invoking the provided functions with the this binding of the - * created function, where each successive invocation is supplied the return value of the previous. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - flow(...funcs: Function[]): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.flow - */ - flow(...funcs: Function[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.flow - */ - flow(...funcs: Function[]): LoDashExplicitObjectWrapper; - } - - //_.flowRight - interface LoDashStatic { - /** - * This method is like _.flow except that it creates a function that invokes the provided functions from right - * to left. - * - * @param funcs Functions to invoke. - * @return Returns the new function. - */ - flowRight(...funcs: Function[]): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.flowRight - */ - flowRight(...funcs: Function[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.flowRight - */ - flowRight(...funcs: Function[]): LoDashExplicitObjectWrapper; - } - - - //_.memoize - interface MemoizedFunction extends Function { - cache: MapCache; - } - - interface LoDashStatic { - /** - * Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for - * storing the result based on the arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with - * the this binding of the memoized function. - * - * @param func The function to have its output memoized. - * @param resolver The function to resolve the cache key. - * @return Returns the new memoizing function. - */ - memoize: { - (func: T, resolver?: Function): T & MemoizedFunction; - Cache: MapCache; - } - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.memoize - */ - memoize(resolver?: Function): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.memoize - */ - memoize(resolver?: Function): LoDashExplicitObjectWrapper; - } - - //_.overArgs (was _.modArgs) - interface LoDashStatic { - /** - * Creates a function that runs each argument through a corresponding transform function. - * - * @param func The function to wrap. - * @param transforms The functions to transform arguments, specified as individual functions or arrays - * of functions. - * @return Returns the new function. - */ - overArgs( - func: T, - ...transforms: Function[] - ): TResult; - - /** - * @see _.overArgs - */ - overArgs( - func: T, - transforms: Function[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.overArgs - */ - overArgs(...transforms: Function[]): LoDashImplicitObjectWrapper; - - /** - * @see _.overArgs - */ - overArgs(transforms: Function[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.overArgs - */ - overArgs(...transforms: Function[]): LoDashExplicitObjectWrapper; - - /** - * @see _.overArgs - */ - overArgs(transforms: Function[]): LoDashExplicitObjectWrapper; - } - - //_.negate - interface LoDashStatic { - /** - * Creates a function that negates the result of the predicate func. The func predicate is invoked with - * the this binding and arguments of the created function. - * - * @param predicate The predicate to negate. - * @return Returns the new function. - */ - negate(predicate: T): (...args: any[]) => boolean; - - /** - * @see _.negate - */ - negate(predicate: T): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.negate - */ - negate(): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; - - /** - * @see _.negate - */ - negate(): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.negate - */ - negate(): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; - - /** - * @see _.negate - */ - negate(): LoDashExplicitObjectWrapper; - } - - //_.once - interface LoDashStatic { - /** - * Creates a function that is restricted to invoking func once. Repeat calls to the function return the value - * of the first call. The func is invoked with the this binding and arguments of the created function. - * - * @param func The function to restrict. - * @return Returns the new restricted function. - */ - once(func: T): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.once - */ - once(): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.once - */ - once(): LoDashExplicitObjectWrapper; - } - - //_.partial - interface LoDashStatic { - /** - * Creates a function that, when called, invokes func with any additional partial arguments - * prepended to those provided to the new function. This method is similar to _.bind except - * it does not alter the this binding. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - partial: Partial; - } - - type PH = LoDashStatic; - - interface Function0 { - (): R; - } - interface Function1 { - (t1: T1): R; - } - interface Function2 { - (t1: T1, t2: T2): R; - } - interface Function3 { - (t1: T1, t2: T2, t3: T3): R; - } - interface Function4 { - (t1: T1, t2: T2, t3: T3, t4: T4): R; - } - - interface Partial { - // arity 0 - (func: Function0): Function0; - // arity 1 - (func: Function1): Function1; - (func: Function1, arg1: T1): Function0; - // arity 2 - (func: Function2): Function2; - (func: Function2, arg1: T1): Function1< T2, R>; - (func: Function2, plc1: PH, arg2: T2): Function1; - (func: Function2, arg1: T1, arg2: T2): Function0< R>; - // arity 3 - (func: Function3): Function3; - (func: Function3, arg1: T1): Function2< T2, T3, R>; - (func: Function3, plc1: PH, arg2: T2): Function2; - (func: Function3, arg1: T1, arg2: T2): Function1< T3, R>; - (func: Function3, plc1: PH, plc2: PH, arg3: T3): Function2; - (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; - (func: Function3, plc1: PH, arg2: T2, arg3: T3): Function1; - (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; - // arity 4 - (func: Function4): Function4; - (func: Function4, arg1: T1): Function3< T2, T3, T4, R>; - (func: Function4, plc1: PH, arg2: T2): Function3; - (func: Function4, arg1: T1, arg2: T2): Function2< T3, T4, R>; - (func: Function4, plc1: PH, plc2: PH, arg3: T3): Function3; - (func: Function4, arg1: T1, plc2: PH, arg3: T3): Function2< T2, T4, R>; - (func: Function4, plc1: PH, arg2: T2, arg3: T3): Function2; - (func: Function4, arg1: T1, arg2: T2, arg3: T3): Function1< T4, R>; - (func: Function4, plc1: PH, plc2: PH, plc3: PH, arg4: T4): Function3; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; - (func: Function4, plc1: PH, arg2: T2, plc3: PH, arg4: T4): Function2; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; - (func: Function4, plc1: PH, plc2: PH, arg3: T3, arg4: T4): Function2; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; - (func: Function4, plc1: PH, arg2: T2, arg3: T3, arg4: T4): Function1; - (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; - // catch-all - (func: Function, ...args: any[]): Function; - } - - //_.partialRight - interface LoDashStatic { - /** - * This method is like _.partial except that partial arguments are appended to those provided - * to the new function. - * @param func The function to partially apply arguments to. - * @param args Arguments to be partially applied. - * @return The new partially applied function. - **/ - partialRight: PartialRight - } - - interface PartialRight { - // arity 0 - (func: Function0): Function0; - // arity 1 - (func: Function1): Function1; - (func: Function1, arg1: T1): Function0; - // arity 2 - (func: Function2): Function2; - (func: Function2, arg1: T1, plc2: PH): Function1< T2, R>; - (func: Function2, arg2: T2): Function1; - (func: Function2, arg1: T1, arg2: T2): Function0< R>; - // arity 3 - (func: Function3): Function3; - (func: Function3, arg1: T1, plc2: PH, plc3: PH): Function2< T2, T3, R>; - (func: Function3, arg2: T2, plc3: PH): Function2; - (func: Function3, arg1: T1, arg2: T2, plc3: PH): Function1< T3, R>; - (func: Function3, arg3: T3): Function2; - (func: Function3, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>; - (func: Function3, arg2: T2, arg3: T3): Function1; - (func: Function3, arg1: T1, arg2: T2, arg3: T3): Function0< R>; - // arity 4 - (func: Function4): Function4; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, plc4: PH): Function3< T2, T3, T4, R>; - (func: Function4, arg2: T2, plc3: PH, plc4: PH): Function3; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, plc4: PH): Function2< T3, T4, R>; - (func: Function4, arg3: T3, plc4: PH): Function3; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, plc4: PH): Function2< T2, T4, R>; - (func: Function4, arg2: T2, arg3: T3, plc4: PH): Function2; - (func: Function4, arg1: T1, arg2: T2, arg3: T3, plc4: PH): Function1< T4, R>; - (func: Function4, arg4: T4): Function3; - (func: Function4, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>; - (func: Function4, arg2: T2, plc3: PH, arg4: T4): Function2; - (func: Function4, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>; - (func: Function4, arg3: T3, arg4: T4): Function2; - (func: Function4, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>; - (func: Function4, arg2: T2, arg3: T3, arg4: T4): Function1; - (func: Function4, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>; - // catch-all - (func: Function, ...args: any[]): Function; - } - - //_.rearg - interface LoDashStatic { - /** - * Creates a function that invokes func with arguments arranged according to the specified indexes where the - * argument value at the first index is provided as the first argument, the argument value at the second index - * is provided as the second argument, and so on. - * @param func The function to rearrange arguments for. - * @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes. - * @return Returns the new function. - */ - rearg(func: Function, indexes: number[]): TResult; - - /** - * @see _.rearg - */ - rearg(func: Function, ...indexes: number[]): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.rearg - */ - rearg(indexes: number[]): LoDashImplicitObjectWrapper; - - /** - * @see _.rearg - */ - rearg(...indexes: number[]): LoDashImplicitObjectWrapper; - } - - //_.rest - interface LoDashStatic { - /** - * Creates a function that invokes func with the this binding of the created function and arguments from start - * and beyond provided as an array. - * - * Note: This method is based on the rest parameter. - * - * @param func The function to apply a rest parameter to. - * @param start The start position of the rest parameter. - * @return Returns the new function. - */ - rest( - func: Function, - start?: number - ): TResult; - - /** - * @see _.rest - */ - rest( - func: TFunc, - start?: number - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.rest - */ - rest(start?: number): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.rest - */ - rest(start?: number): LoDashExplicitObjectWrapper; - } - - //_.spread - interface LoDashStatic { - /** - * Creates a function that invokes func with the this binding of the created function and an array of arguments - * much like Function#apply. - * - * Note: This method is based on the spread operator. - * - * @param func The function to spread arguments over. - * @return Returns the new function. - */ - spread(func: F): T; - - /** - * @see _.spread - */ - spread(func: Function): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.spread - */ - spread(): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.spread - */ - spread(): LoDashExplicitObjectWrapper; - } - - //_.throttle - interface ThrottleSettings { - /** - * If you'd like to disable the leading-edge call, pass this as false. - */ - leading?: boolean; - - /** - * If you'd like to disable the execution on the trailing-edge, pass false. - */ - trailing?: boolean; - } - - interface LoDashStatic { - /** - * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations. Provide an options object to indicate - * that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent calls to - * the throttled function return the result of the last func call. - * - * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if - * the the throttled function is invoked more than once during the wait timeout. - * - * @param func The function to throttle. - * @param wait The number of milliseconds to throttle invocations to. - * @param options The options object. - * @param options.leading Specify invoking on the leading edge of the timeout. - * @param options.trailing Specify invoking on the trailing edge of the timeout. - * @return Returns the new throttled function. - */ - throttle( - func: T, - wait?: number, - options?: ThrottleSettings - ): T & Cancelable; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.throttle - */ - throttle( - wait?: number, - options?: ThrottleSettings - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.throttle - */ - throttle( - wait?: number, - options?: ThrottleSettings - ): LoDashExplicitObjectWrapper; - } - - //_.unary - interface LoDashStatic { - /** - * Creates a function that accepts up to one argument, ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.unary(parseInt)); - * // => [6, 8, 10] - */ - unary(func: T): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.unary - */ - unary(): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.unary - */ - unary(): LoDashExplicitObjectWrapper; - } - - //_.wrap - interface LoDashStatic { - /** - * Creates a function that provides value to the wrapper function as its first argument. Any additional - * arguments provided to the function are appended to those provided to the wrapper function. The wrapper is - * invoked with the this binding of the created function. - * - * @param value The value to wrap. - * @param wrapper The wrapper function. - * @return Returns the new function. - */ - wrap( - value: V, - wrapper: W - ): R; - - /** - * @see _.wrap - */ - wrap( - value: V, - wrapper: Function - ): R; - - /** - * @see _.wrap - */ - wrap( - value: any, - wrapper: Function - ): R; - } - - interface LoDashImplicitWrapper { - /** - * @see _.wrap - */ - wrap(wrapper: W): LoDashImplicitObjectWrapper; - - /** - * @see _.wrap - */ - wrap(wrapper: Function): LoDashImplicitObjectWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.wrap - */ - wrap(wrapper: W): LoDashImplicitObjectWrapper; - - /** - * @see _.wrap - */ - wrap(wrapper: Function): LoDashImplicitObjectWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.wrap - */ - wrap(wrapper: W): LoDashImplicitObjectWrapper; - - /** - * @see _.wrap - */ - wrap(wrapper: Function): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.wrap - */ - wrap(wrapper: W): LoDashExplicitObjectWrapper; - - /** - * @see _.wrap - */ - wrap(wrapper: Function): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.wrap - */ - wrap(wrapper: W): LoDashExplicitObjectWrapper; - - /** - * @see _.wrap - */ - wrap(wrapper: Function): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.wrap - */ - wrap(wrapper: W): LoDashExplicitObjectWrapper; - - /** - * @see _.wrap - */ - wrap(wrapper: Function): LoDashExplicitObjectWrapper; - } - - /******** - * Lang * - ********/ - - //_.castArray - interface LoDashStatic { - /** - * Casts value as an array if it’s not one. - * - * @param value The value to inspect. - * @return Returns the cast array. - */ - castArray(value: T): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.castArray - */ - castArray(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.castArray - */ - castArray(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.castArray - */ - castArray(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.castArray - */ - castArray(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.castArray - */ - castArray(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.castArray - */ - castArray(): LoDashExplicitArrayWrapper; - } - - //_.clone - interface LoDashStatic { - /** - * Creates a shallow clone of value. - * - * Note: This method is loosely based on the structured clone algorithm and supports cloning arrays, - * array buffers, booleans, date objects, maps, numbers, Object objects, regexes, sets, strings, symbols, - * and typed arrays. The own enumerable properties of arguments objects are cloned as plain objects. An empty - * object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps. - * - * @param value The value to clone. - * @return Returns the cloned value. - */ - clone(value: T): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.clone - */ - clone(): T; - } - - interface LoDashImplicitArrayWrapper { - - /** - * @see _.clone - */ - clone(): T[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.clone - */ - clone(): T; - } - - interface LoDashExplicitWrapper { - /** - * @see _.clone - */ - clone(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - - /** - * @see _.clone - */ - clone(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.clone - */ - clone(): LoDashExplicitObjectWrapper; - } - - //_.cloneDeep - interface LoDashStatic { - /** - * This method is like _.clone except that it recursively clones value. - * - * @param value The value to recursively clone. - * @return Returns the deep cloned value. - */ - cloneDeep(value: T): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): T; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): T[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): T; - } - - interface LoDashExplicitWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.cloneDeep - */ - cloneDeep(): LoDashExplicitObjectWrapper; - } - - //_.cloneDeepWith - interface CloneDeepWithCustomizer { - (value: TValue): TResult; - } - - interface LoDashStatic { - /** - * This method is like _.cloneWith except that it recursively clones value. - * - * @param value The value to recursively clone. - * @param customizer The function to customize cloning. - * @return Returns the deep cloned value. - */ - cloneDeepWith( - value: any, - customizer?: CloneDeepWithCustomizer - ): TResult; - - /** - * @see _.clonDeepeWith - */ - cloneDeepWith( - value: T, - customizer?: CloneDeepWithCustomizer - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): TResult; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): TResult; - } - - interface LoDashExplicitWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitArrayWrapper; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitArrayWrapper; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitArrayWrapper; - - /** - * @see _.cloneDeepWith - */ - cloneDeepWith( - customizer?: CloneDeepWithCustomizer - ): LoDashExplicitObjectWrapper; - } - - //_.cloneWith - interface CloneWithCustomizer { - (value: TValue): TResult; - } - - interface LoDashStatic { - /** - * This method is like _.clone except that it accepts customizer which is invoked to produce the cloned value. - * If customizer returns undefined cloning is handled by the method instead. - * - * @param value The value to clone. - * @param customizer The function to customize cloning. - * @return Returns the cloned value. - */ - cloneWith( - value: any, - customizer?: CloneWithCustomizer - ): TResult; - - /** - * @see _.cloneWith - */ - cloneWith( - value: T, - customizer?: CloneWithCustomizer - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): TResult; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): TResult; - } - - interface LoDashExplicitWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitArrayWrapper; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitArrayWrapper; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitWrapper; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitArrayWrapper; - - /** - * @see _.cloneWith - */ - cloneWith( - customizer?: CloneWithCustomizer - ): LoDashExplicitObjectWrapper; - } - - //_.eq - interface LoDashStatic { - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - eq( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isEqual - */ - eq( - other: any - ): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isEqual - */ - eq( - other: any - ): LoDashExplicitWrapper; - } - - //_.gt - interface LoDashStatic { - /** - * Checks if value is greater than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than other, else false. - */ - gt( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.gt - */ - gt(other: any): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.gt - */ - gt(other: any): LoDashExplicitWrapper; - } - - //_.gte - interface LoDashStatic { - /** - * Checks if value is greater than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is greater than or equal to other, else false. - */ - gte( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.gte - */ - gte(other: any): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.gte - */ - gte(other: any): LoDashExplicitWrapper; - } - - //_.isArguments - interface LoDashStatic { - /** - * Checks if value is classified as an arguments object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isArguments(value?: any): value is IArguments; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isArguments - */ - isArguments(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isArguments - */ - isArguments(): LoDashExplicitWrapper; - } - - //_.isArray - interface LoDashStatic { - /** - * Checks if value is classified as an Array object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - isArray(value?: any): value is T[]; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isArray - */ - isArray(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isArray - */ - isArray(): LoDashExplicitWrapper; - } - - //_.isArrayBuffer - interface LoDashStatic { - /** - * Checks if value is classified as an ArrayBuffer object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isArrayBuffer(value?: any): value is ArrayBuffer; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isArrayBuffer - */ - isArrayBuffer(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isArrayBuffer - */ - isArrayBuffer(): LoDashExplicitWrapper; - } - - //_.isArrayLike - interface LoDashStatic { - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - isArrayLike(value?: any): value is T[]; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isArrayLike - */ - isArrayLike(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isArrayLike - */ - isArrayLike(): LoDashExplicitWrapper; - } - - //_.isArrayLikeObject - interface LoDashStatic { - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - isArrayLikeObject(value?: any): value is T[]; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isArrayLikeObject - */ - isArrayLikeObject(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isArrayLikeObject - */ - isArrayLikeObject(): LoDashExplicitWrapper; - } - - //_.isBoolean - interface LoDashStatic { - /** - * Checks if value is classified as a boolean primitive or object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isBoolean(value?: any): value is boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isBoolean - */ - isBoolean(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isBoolean - */ - isBoolean(): LoDashExplicitWrapper; - } - - //_.isBuffer - interface LoDashStatic { - /** - * Checks if value is a buffer. - * - * @param value The value to check. - * @return Returns true if value is a buffer, else false. - */ - isBuffer(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isBuffer - */ - isBuffer(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isBuffer - */ - isBuffer(): LoDashExplicitWrapper; - } - - //_.isDate - interface LoDashStatic { - /** - * Checks if value is classified as a Date object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - isDate(value?: any): value is Date; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isDate - */ - isDate(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isDate - */ - isDate(): LoDashExplicitWrapper; - } - - //_.isElement - interface LoDashStatic { - /** - * Checks if value is a DOM element. - * - * @param value The value to check. - * @return Returns true if value is a DOM element, else false. - */ - isElement(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isElement - */ - isElement(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isElement - */ - isElement(): LoDashExplicitWrapper; - } - - //_.isEmpty - interface LoDashStatic { - /** - * Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or - * jQuery-like collection with a length greater than 0 or an object with own enumerable properties. - * - * @param value The value to inspect. - * @return Returns true if value is empty, else false. - */ - isEmpty(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isEmpty - */ - isEmpty(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isEmpty - */ - isEmpty(): LoDashExplicitWrapper; - } - - //_.isEqual - interface LoDashStatic { - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - isEqual( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isEqual - */ - isEqual( - other: any - ): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isEqual - */ - isEqual( - other: any - ): LoDashExplicitWrapper; - } - - // _.isEqualWith - interface IsEqualCustomizer { - (value: any, other: any, indexOrKey?: number|string): boolean; - } - - interface LoDashStatic { - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - isEqualWith( - value: any, - other: any, - customizer: IsEqualCustomizer - ): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isEqualWith - */ - isEqualWith( - other: any, - customizer: IsEqualCustomizer - ): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isEqualWith - */ - isEqualWith( - other: any, - customizer: IsEqualCustomizer - ): LoDashExplicitWrapper; - } - - //_.isError - interface LoDashStatic { - /** - * Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError - * object. - * - * @param value The value to check. - * @return Returns true if value is an error object, else false. - */ - isError(value: any): value is Error; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isError - */ - isError(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isError - */ - isError(): LoDashExplicitWrapper; - } - - //_.isFinite - interface LoDashStatic { - /** - * Checks if value is a finite primitive number. - * - * Note: This method is based on Number.isFinite. - * - * @param value The value to check. - * @return Returns true if value is a finite number, else false. - */ - isFinite(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isFinite - */ - isFinite(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isFinite - */ - isFinite(): LoDashExplicitWrapper; - } - - //_.isFunction - interface LoDashStatic { - /** - * Checks if value is classified as a Function object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isFunction(value?: any): value is Function; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isFunction - */ - isFunction(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isFunction - */ - isFunction(): LoDashExplicitWrapper; - } - - //_.isInteger - interface LoDashStatic { - /** - * Checks if `value` is an integer. - * - * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ - isInteger(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isInteger - */ - isInteger(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isInteger - */ - isInteger(): LoDashExplicitWrapper; - } - - //_.isLength - interface LoDashStatic { - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - isLength(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isLength - */ - isLength(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isLength - */ - isLength(): LoDashExplicitWrapper; - } - - //_.isMap - interface LoDashStatic { - /** - * Checks if value is classified as a Map object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isMap(value?: any): value is Map; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isMap - */ - isMap(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isMap - */ - isMap(): LoDashExplicitWrapper; - } - - //_.isMatch - interface isMatchCustomizer { - (value: any, other: any, indexOrKey?: number|string): boolean; - } - - interface LoDashStatic { - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @static - * @memberOf _ - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - isMatch(object: Object, source: Object): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.isMatch - */ - isMatch(source: Object): boolean; - } - - //_.isMatchWith - interface isMatchWithCustomizer { - (value: any, other: any, indexOrKey?: number|string): boolean; - } - - interface LoDashStatic { - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). - * - * @static - * @memberOf _ - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - isMatchWith(object: Object, source: Object, customizer: isMatchWithCustomizer): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.isMatchWith - */ - isMatchWith(source: Object, customizer: isMatchWithCustomizer): boolean; - } - - //_.isNaN - interface LoDashStatic { - /** - * Checks if value is NaN. - * - * Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values. - * - * @param value The value to check. - * @return Returns true if value is NaN, else false. - */ - isNaN(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isNaN - */ - isNaN(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isNaN - */ - isNaN(): LoDashExplicitWrapper; - } - - //_.isNative - interface LoDashStatic { - /** - * Checks if value is a native function. - * @param value The value to check. - * - * @retrun Returns true if value is a native function, else false. - */ - isNative(value: any): value is Function; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isNative - */ - isNative(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isNative - */ - isNative(): LoDashExplicitWrapper; - } - - //_.isNil - interface LoDashStatic { - /** - * Checks if `value` is `null` or `undefined`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ - isNil(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isNil - */ - isNil(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isNil - */ - isNil(): LoDashExplicitWrapper; - } - - //_.isNull - interface LoDashStatic { - /** - * Checks if value is null. - * - * @param value The value to check. - * @return Returns true if value is null, else false. - */ - isNull(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isNull - */ - isNull(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isNull - */ - isNull(): LoDashExplicitWrapper; - } - - //_.isNumber - interface LoDashStatic { - /** - * Checks if value is classified as a Number primitive or object. - * - * Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isNumber(value?: any): value is number; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isNumber - */ - isNumber(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isNumber - */ - isNumber(): LoDashExplicitWrapper; - } - - //_.isObject - interface LoDashStatic { - /** - * Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0), - * and new String('')) - * - * @param value The value to check. - * @return Returns true if value is an object, else false. - */ - isObject(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isObject - */ - isObject(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isObject - */ - isObject(): LoDashExplicitWrapper; - } - - //_.isObjectLike - interface LoDashStatic { - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - isObjectLike(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isObjectLike - */ - isObjectLike(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isObjectLike - */ - isObjectLike(): LoDashExplicitWrapper; - } - - //_.isPlainObject - interface LoDashStatic { - /** - * Checks if value is a plain object, that is, an object created by the Object constructor or one with a - * [[Prototype]] of null. - * - * Note: This method assumes objects created by the Object constructor have no inherited enumerable properties. - * - * @param value The value to check. - * @return Returns true if value is a plain object, else false. - */ - isPlainObject(value?: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isPlainObject - */ - isPlainObject(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isPlainObject - */ - isPlainObject(): LoDashExplicitWrapper; - } - - //_.isRegExp - interface LoDashStatic { - /** - * Checks if value is classified as a RegExp object. - * @param value The value to check. - * - * @return Returns true if value is correctly classified, else false. - */ - isRegExp(value?: any): value is RegExp; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isRegExp - */ - isRegExp(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isRegExp - */ - isRegExp(): LoDashExplicitWrapper; - } - - //_.isSafeInteger - interface LoDashStatic { - /** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. - * @example - * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false - */ - isSafeInteger(value: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isSafeInteger - */ - isSafeInteger(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isSafeInteger - */ - isSafeInteger(): LoDashExplicitWrapper; - } - - //_.isSet - interface LoDashStatic { - /** - * Checks if value is classified as a Set object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isSet(value?: any): value is Set; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isSet - */ - isSet(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isSet - */ - isSet(): LoDashExplicitWrapper; - } - - //_.isString - interface LoDashStatic { - /** - * Checks if value is classified as a String primitive or object. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isString(value?: any): value is string; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isString - */ - isString(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isString - */ - isString(): LoDashExplicitWrapper; - } - - //_.isSymbol - interface LoDashStatic { - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - isSymbol(value: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isSymbol - */ - isSymbol(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isSymbol - */ - isSymbol(): LoDashExplicitWrapper; - } - - //_.isTypedArray - interface LoDashStatic { - /** - * Checks if value is classified as a typed array. - * - * @param value The value to check. - * @return Returns true if value is correctly classified, else false. - */ - isTypedArray(value: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isTypedArray - */ - isTypedArray(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isTypedArray - */ - isTypedArray(): LoDashExplicitWrapper; - } - - //_.isUndefined - interface LoDashStatic { - /** - * Checks if value is undefined. - * - * @param value The value to check. - * @return Returns true if value is undefined, else false. - */ - isUndefined(value: any): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * see _.isUndefined - */ - isUndefined(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * see _.isUndefined - */ - isUndefined(): LoDashExplicitWrapper; - } - - //_.isWeakMap - interface LoDashStatic { - /** - * Checks if value is classified as a WeakMap object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isWeakMap(value?: any): value is WeakMap; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isSet - */ - isWeakMap(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isSet - */ - isWeakMap(): LoDashExplicitWrapper; - } - - //_.isWeakSet - interface LoDashStatic { - /** - * Checks if value is classified as a WeakSet object. - * - * @param value The value to check. - * @returns Returns true if value is correctly classified, else false. - */ - isWeakSet(value?: any): value is WeakSet; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.isWeakSet - */ - isWeakSet(): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.isWeakSet - */ - isWeakSet(): LoDashExplicitWrapper; - } - - //_.lt - interface LoDashStatic { - /** - * Checks if value is less than other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than other, else false. - */ - lt( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.lt - */ - lt(other: any): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.lt - */ - lt(other: any): LoDashExplicitWrapper; - } - - //_.lte - interface LoDashStatic { - /** - * Checks if value is less than or equal to other. - * - * @param value The value to compare. - * @param other The other value to compare. - * @return Returns true if value is less than or equal to other, else false. - */ - lte( - value: any, - other: any - ): boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.lte - */ - lte(other: any): boolean; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.lte - */ - lte(other: any): LoDashExplicitWrapper; - } - - //_.toArray - interface LoDashStatic { - /** - * Converts value to an array. - * - * @param value The value to convert. - * @return Returns the converted array. - */ - toArray(value: List|Dictionary|NumericDictionary): T[]; - - /** - * @see _.toArray - */ - toArray(value: TValue): TResult[]; - - /** - * @see _.toArray - */ - toArray(value?: any): TResult[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toArray - */ - toArray(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.toArray - */ - toArray(): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.toArray - */ - toArray(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toArray - */ - toArray(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.toArray - */ - toArray(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.toArray - */ - toArray(): LoDashExplicitArrayWrapper; - } - - //_.toPlainObject - interface LoDashStatic { - /** - * Converts value to a plain object flattening inherited enumerable properties of value to own properties - * of the plain object. - * - * @param value The value to convert. - * @return Returns the converted plain object. - */ - toPlainObject(value?: any): TResult; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.toPlainObject - */ - toPlainObject(): LoDashImplicitObjectWrapper; - } - - //_.toInteger - interface LoDashStatic { - /** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3'); - * // => 3 - */ - toInteger(value: any): number; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.toInteger - */ - toInteger(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.toInteger - */ - toInteger(): LoDashExplicitWrapper; - } - - //_.toLength - interface LoDashStatic { - /** - * Converts `value` to an integer suitable for use as the length of an - * array-like object. - * - * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @return {number} Returns the converted integer. - * @example - * - * _.toLength(3); - * // => 3 - * - * _.toLength(Number.MIN_VALUE); - * // => 0 - * - * _.toLength(Infinity); - * // => 4294967295 - * - * _.toLength('3'); - * // => 3 - */ - toLength(value: any): number; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.toLength - */ - toLength(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.toLength - */ - toLength(): LoDashExplicitWrapper; - } - - //_.toNumber - interface LoDashStatic { - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3); - * // => 3 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3'); - * // => 3 - */ - toNumber(value: any): number; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.toNumber - */ - toNumber(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.toNumber - */ - toNumber(): LoDashExplicitWrapper; - } - - //_.toSafeInteger - interface LoDashStatic { - /** - * Converts `value` to a safe integer. A safe integer can be compared and - * represented correctly. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toSafeInteger(3); - * // => 3 - * - * _.toSafeInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toSafeInteger(Infinity); - * // => 9007199254740991 - * - * _.toSafeInteger('3'); - * // => 3 - */ - toSafeInteger(value: any): number; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.toSafeInteger - */ - toSafeInteger(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.toSafeInteger - */ - toSafeInteger(): LoDashExplicitWrapper; - } - - //_.toString DUMMY - interface LoDashStatic { - /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - toString(value: any): string; - } - - /******** - * Math * - ********/ - - //_.add - interface LoDashStatic { - /** - * Adds two numbers. - * - * @param augend The first number to add. - * @param addend The second number to add. - * @return Returns the sum. - */ - add( - augend: number, - addend: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.add - */ - add(addend: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.add - */ - add(addend: number): LoDashExplicitWrapper; - } - - //_.ceil - interface LoDashStatic { - /** - * Calculates n rounded up to precision. - * - * @param n The number to round up. - * @param precision The precision to round up to. - * @return Returns the rounded up number. - */ - ceil( - n: number, - precision?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.ceil - */ - ceil(precision?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.ceil - */ - ceil(precision?: number): LoDashExplicitWrapper; - } - - //_.floor - interface LoDashStatic { - /** - * Calculates n rounded down to precision. - * - * @param n The number to round down. - * @param precision The precision to round down to. - * @return Returns the rounded down number. - */ - floor( - n: number, - precision?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.floor - */ - floor(precision?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.floor - */ - floor(precision?: number): LoDashExplicitWrapper; - } - - //_.max - interface LoDashStatic { - /** - * Computes the maximum value of `array`. If `array` is empty or falsey - * `undefined` is returned. - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @returns {*} Returns the maximum value. - */ - max( - collection: List - ): T; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.max - */ - max(): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.max - */ - max(): T; - } - - //_.maxBy - interface LoDashStatic { - /** - * This method is like `_.max` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {*} Returns the maximum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.maxBy(objects, function(o) { return o.a; }); - * // => { 'n': 2 } - * - * // using the `_.property` iteratee shorthand - * _.maxBy(objects, 'n'); - * // => { 'n': 2 } - */ - maxBy( - collection: List, - iteratee?: ListIterator - ): T; - - /** - * @see _.maxBy - */ - maxBy( - collection: Dictionary, - iteratee?: DictionaryIterator - ): T; - - /** - * @see _.maxBy - */ - maxBy( - collection: List|Dictionary, - iteratee?: string - ): T; - - /** - * @see _.maxBy - */ - maxBy( - collection: List|Dictionary, - whereValue?: TObject - ): T; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.maxBy - */ - maxBy( - iteratee?: ListIterator - ): T; - - /** - * @see _.maxBy - */ - maxBy( - iteratee?: string - ): T; - - /** - * @see _.maxBy - */ - maxBy( - whereValue?: TObject - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.maxBy - */ - maxBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): T; - - /** - * @see _.maxBy - */ - maxBy( - iteratee?: string, - thisArg?: any - ): T; - - /** - * @see _.maxBy - */ - maxBy( - whereValue?: TObject - ): T; - } - - //_.mean - interface LoDashStatic { - /** - * Computes the mean of the values in `array`. - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @returns {number} Returns the mean. - * @example - * - * _.mean([4, 2, 8, 6]); - * // => 5 - */ - mean( - collection: List - ): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.mean - */ - mean(): number; - - /** - * @see _.mean - */ - mean(): number; - } - - //_.min - interface LoDashStatic { - /** - * Computes the minimum value of `array`. If `array` is empty or falsey - * `undefined` is returned. - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @returns {*} Returns the minimum value. - */ - min( - collection: List - ): T; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.min - */ - min(): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.min - */ - min(): T; - } - - //_.minBy - interface LoDashStatic { - /** - * This method is like `_.min` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * the value is ranked. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {*} Returns the minimum value. - * @example - * - * var objects = [{ 'n': 1 }, { 'n': 2 }]; - * - * _.minBy(objects, function(o) { return o.a; }); - * // => { 'n': 1 } - * - * // using the `_.property` iteratee shorthand - * _.minBy(objects, 'n'); - * // => { 'n': 1 } - */ - minBy( - collection: List, - iteratee?: ListIterator - ): T; - - /** - * @see _.minBy - */ - minBy( - collection: Dictionary, - iteratee?: DictionaryIterator - ): T; - - /** - * @see _.minBy - */ - minBy( - collection: List|Dictionary, - iteratee?: string - ): T; - - /** - * @see _.minBy - */ - minBy( - collection: List|Dictionary, - whereValue?: TObject - ): T; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.minBy - */ - minBy( - iteratee?: ListIterator - ): T; - - /** - * @see _.minBy - */ - minBy( - iteratee?: string - ): T; - - /** - * @see _.minBy - */ - minBy( - whereValue?: TObject - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.minBy - */ - minBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): T; - - /** - * @see _.minBy - */ - minBy( - iteratee?: string, - thisArg?: any - ): T; - - /** - * @see _.minBy - */ - minBy( - whereValue?: TObject - ): T; - } - - //_.round - interface LoDashStatic { - /** - * Calculates n rounded to precision. - * - * @param n The number to round. - * @param precision The precision to round to. - * @return Returns the rounded number. - */ - round( - n: number, - precision?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.round - */ - round(precision?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.round - */ - round(precision?: number): LoDashExplicitWrapper; - } - - //_.sum - interface LoDashStatic { - /** - * Computes the sum of the values in `array`. - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @returns {number} Returns the sum. - * @example - * - * _.sum([4, 2, 8, 6]); - * // => 20 - */ - sum(collection: List): number; - - /** - * @see _.sum - */ - sum(collection: List|Dictionary): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sum - */ - sum(): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sum - **/ - sum(): number; - - /** - * @see _.sum - */ - sum(): number; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sum - */ - sum(): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sum - */ - sum(): LoDashExplicitWrapper; - - /** - * @see _.sum - */ - sum(): LoDashExplicitWrapper; - } - - //_.sumBy - interface LoDashStatic { - /** - * This method is like `_.sum` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the value to be summed. - * The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the sum. - * @example - * - * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; - * - * _.sumBy(objects, function(o) { return o.n; }); - * // => 20 - * - * // using the `_.property` iteratee shorthand - * _.sumBy(objects, 'n'); - * // => 20 - */ - sumBy( - collection: List, - iteratee: ListIterator - ): number; - - /** - * @see _.sumBy - **/ - sumBy( - collection: Dictionary, - iteratee: DictionaryIterator - ): number; - - /** - * @see _.sumBy - */ - sumBy( - collection: List|Dictionary, - iteratee: string - ): number; - - /** - * @see _.sumBy - */ - sumBy(collection: List|Dictionary): number; - - /** - * @see _.sumBy - */ - sumBy(collection: List|Dictionary): number; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.sumBy - */ - sumBy( - iteratee: ListIterator - ): number; - - /** - * @see _.sumBy - */ - sumBy(iteratee: string): number; - - /** - * @see _.sumBy - */ - sumBy(): number; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.sumBy - **/ - sumBy( - iteratee: ListIterator|DictionaryIterator - ): number; - - /** - * @see _.sumBy - */ - sumBy(iteratee: string): number; - - /** - * @see _.sumBy - */ - sumBy(): number; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.sumBy - */ - sumBy( - iteratee: ListIterator - ): LoDashExplicitWrapper; - - /** - * @see _.sumBy - */ - sumBy(iteratee: string): LoDashExplicitWrapper; - - /** - * @see _.sumBy - */ - sumBy(): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.sumBy - */ - sumBy( - iteratee: ListIterator|DictionaryIterator - ): LoDashExplicitWrapper; - - /** - * @see _.sumBy - */ - sumBy(iteratee: string): LoDashExplicitWrapper; - - /** - * @see _.sumBy - */ - sumBy(): LoDashExplicitWrapper; - } - - /********** - * Number * - **********/ - - //_.subtract - interface LoDashStatic { - /** - * Subtract two numbers. - * - * @static - * @memberOf _ - * @category Math - * @param {number} minuend The first number in a subtraction. - * @param {number} subtrahend The second number in a subtraction. - * @returns {number} Returns the difference. - * @example - * - * _.subtract(6, 4); - * // => 2 - */ - subtract( - minuend: number, - subtrahend: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.subtract - */ - subtract( - subtrahend: number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.subtract - */ - subtract( - subtrahend: number - ): LoDashExplicitWrapper; - } - - //_.clamp - interface LoDashStatic { - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @static - * @memberOf _ - * @category Number - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - clamp( - number: number, - lower: number, - upper: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.clamp - */ - clamp( - lower: number, - upper: number - ): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.clamp - */ - clamp( - lower: number, - upper: number - ): LoDashExplicitWrapper; - } - - //_.inRange - interface LoDashStatic { - /** - * Checks if n is between start and up to but not including, end. If end is not specified it’s set to start - * with start then set to 0. - * - * @param n The number to check. - * @param start The start of the range. - * @param end The end of the range. - * @return Returns true if n is in the range, else false. - */ - inRange( - n: number, - start: number, - end: number - ): boolean; - - - /** - * @see _.inRange - */ - inRange( - n: number, - end: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.inRange - */ - inRange( - start: number, - end: number - ): boolean; - - /** - * @see _.inRange - */ - inRange(end: number): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.inRange - */ - inRange( - start: number, - end: number - ): LoDashExplicitWrapper; - - /** - * @see _.inRange - */ - inRange(end: number): LoDashExplicitWrapper; - } - - //_.random - interface LoDashStatic { - /** - * Produces a random number between min and max (inclusive). If only one argument is provided a number between - * 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point - * number is returned instead of an integer. - * - * @param min The minimum possible value. - * @param max The maximum possible value. - * @param floating Specify returning a floating-point number. - * @return Returns the random number. - */ - random( - min?: number, - max?: number, - floating?: boolean - ): number; - - /** - * @see _.random - */ - random( - min?: number, - floating?: boolean - ): number; - - /** - * @see _.random - */ - random(floating?: boolean): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.random - */ - random( - max?: number, - floating?: boolean - ): number; - - /** - * @see _.random - */ - random(floating?: boolean): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.random - */ - random( - max?: number, - floating?: boolean - ): LoDashExplicitWrapper; - - /** - * @see _.random - */ - random(floating?: boolean): LoDashExplicitWrapper; - } - - /********** - * Object * - **********/ - - //_.assign - interface LoDashStatic { - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - assign( - object: TObject, - source: TSource - ): TResult; - - /** - * @see assign - */ - assign( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TResult; - - /** - * @see assign - */ - assign( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TResult; - - /** - * @see assign - */ - assign - ( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TResult; - - /** - * @see _.assign - */ - assign(object: TObject): TObject; - - /** - * @see _.assign - */ - assign( - object: TObject, ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.assign - */ - assign( - source: TSource - ): LoDashImplicitObjectWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitObjectWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitObjectWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assign - */ - assign(): LoDashImplicitObjectWrapper; - - /** - * @see _.assign - */ - assign(...otherArgs: any[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.assign - */ - assign( - source: TSource - ): LoDashExplicitObjectWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitObjectWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitObjectWrapper; - - /** - * @see assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assign - */ - assign(): LoDashExplicitObjectWrapper; - - /** - * @see _.assign - */ - assign(...otherArgs: any[]): LoDashExplicitObjectWrapper; - } - - //_.assignWith - interface AssignCustomizer { - (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}): any; - } - - interface LoDashStatic { - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - assignWith( - object: TObject, - source: TSource, - customizer: AssignCustomizer - ): TResult; - - /** - * @see assignWith - */ - assignWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): TResult; - - /** - * @see assignWith - */ - assignWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): TResult; - - /** - * @see assignWith - */ - assignWith - ( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): TResult; - - /** - * @see _.assignWith - */ - assignWith(object: TObject): TObject; - - /** - * @see _.assignWith - */ - assignWith( - object: TObject, ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.assignWith - */ - assignWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assignWith - */ - assignWith(): LoDashImplicitObjectWrapper; - - /** - * @see _.assignWith - */ - assignWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.assignWith - */ - assignWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see assignWith - */ - assignWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assignWith - */ - assignWith(): LoDashExplicitObjectWrapper; - - /** - * @see _.assignWith - */ - assignWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; - } - - //_.assignIn - interface LoDashStatic { - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - assignIn( - object: TObject, - source: TSource - ): TResult; - - /** - * @see assignIn - */ - assignIn( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TResult; - - /** - * @see assignIn - */ - assignIn( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TResult; - - /** - * @see assignIn - */ - assignIn - ( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TResult; - - /** - * @see _.assignIn - */ - assignIn(object: TObject): TObject; - - /** - * @see _.assignIn - */ - assignIn( - object: TObject, ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.assignIn - */ - assignIn( - source: TSource - ): LoDashImplicitObjectWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitObjectWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitObjectWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assignIn - */ - assignIn(): LoDashImplicitObjectWrapper; - - /** - * @see _.assignIn - */ - assignIn(...otherArgs: any[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.assignIn - */ - assignIn( - source: TSource - ): LoDashExplicitObjectWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitObjectWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitObjectWrapper; - - /** - * @see assignIn - */ - assignIn( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assignIn - */ - assignIn(): LoDashExplicitObjectWrapper; - - /** - * @see _.assignIn - */ - assignIn(...otherArgs: any[]): LoDashExplicitObjectWrapper; - } - - //_.assignInWith - interface AssignCustomizer { - (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}): any; - } - - interface LoDashStatic { - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @alias extendWith - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - assignInWith( - object: TObject, - source: TSource, - customizer: AssignCustomizer - ): TResult; - - /** - * @see assignInWith - */ - assignInWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): TResult; - - /** - * @see assignInWith - */ - assignInWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): TResult; - - /** - * @see assignInWith - */ - assignInWith - ( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): TResult; - - /** - * @see _.assignInWith - */ - assignInWith(object: TObject): TObject; - - /** - * @see _.assignInWith - */ - assignInWith( - object: TObject, ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.assignInWith - */ - assignInWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(): LoDashImplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(...otherArgs: any[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.assignInWith - */ - assignInWith( - source: TSource, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see assignInWith - */ - assignInWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: AssignCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(): LoDashExplicitObjectWrapper; - - /** - * @see _.assignInWith - */ - assignInWith(...otherArgs: any[]): LoDashExplicitObjectWrapper; - } - - //_.create - interface LoDashStatic { - /** - * Creates an object that inherits from the given prototype object. If a properties object is provided its own - * enumerable properties are assigned to the created object. - * - * @param prototype The object to inherit from. - * @param properties The properties to assign to the object. - * @return Returns the new object. - */ - create( - prototype: T, - properties?: U - ): T & U; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.create - */ - create(properties?: U): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.create - */ - create(properties?: U): LoDashExplicitObjectWrapper; - } - - //_.defaults - interface LoDashStatic { - /** - * Assigns own enumerable properties of source object(s) to the destination object for all destination - * properties that resolve to undefined. Once a property is set, additional values of the same property are - * ignored. - * - * Note: This method mutates object. - * - * @param object The destination object. - * @param sources The source objects. - * @return The destination object. - */ - defaults( - object: Obj, - ...sources: {}[] - ): TResult; - - /** - * @see _.defaults - */ - defaults( - object: Obj, - source1: S1, - ...sources: {}[] - ): TResult; - - /** - * @see _.defaults - */ - defaults( - object: Obj, - source1: S1, - source2: S2, - ...sources: {}[] - ): TResult; - - /** - * @see _.defaults - */ - defaults( - object: Obj, - source1: S1, - source2: S2, - source3: S3, - ...sources: {}[] - ): TResult; - - /** - * @see _.defaults - */ - defaults( - object: Obj, - source1: S1, - source2: S2, - source3: S3, - source4: S4, - ...sources: {}[] - ): TResult; - - /** - * @see _.defaults - */ - defaults( - object: {}, - ...sources: {}[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.defaults - */ - defaults( - source1: S1, - ...sources: {}[] - ): LoDashImplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: S1, - source2: S2, - ...sources: {}[] - ): LoDashImplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: S1, - source2: S2, - source3: S3, - ...sources: {}[] - ): LoDashImplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: S1, - source2: S2, - source3: S3, - source4: S4, - ...sources: {}[] - ): LoDashImplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults(): LoDashImplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults(...sources: {}[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.defaults - */ - defaults( - source1: S1, - ...sources: {}[] - ): LoDashExplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: S1, - source2: S2, - ...sources: {}[] - ): LoDashExplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: S1, - source2: S2, - source3: S3, - ...sources: {}[] - ): LoDashExplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: S1, - source2: S2, - source3: S3, - source4: S4, - ...sources: {}[] - ): LoDashExplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults(): LoDashExplicitObjectWrapper; - - /** - * @see _.defaults - */ - defaults(...sources: {}[]): LoDashExplicitObjectWrapper; - } - - //_.defaultsDeep - interface LoDashStatic { - /** - * This method is like _.defaults except that it recursively assigns default properties. - * @param object The destination object. - * @param sources The source objects. - * @return Returns object. - **/ - defaultsDeep( - object: T, - ...sources: any[]): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.defaultsDeep - **/ - defaultsDeep(...sources: any[]): LoDashImplicitObjectWrapper - } - - //_.extend - interface LoDashStatic { - /** - * @see assign - */ - extend( - object: TObject, - source: TSource, - customizer?: AssignCustomizer, - thisArg?: any - ): TResult; - - /** - * @see assign - */ - extend( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer?: AssignCustomizer, - thisArg?: any - ): TResult; - - /** - * @see assign - */ - extend( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer?: AssignCustomizer, - thisArg?: any - ): TResult; - - /** - * @see assign - */ - extend - ( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer?: AssignCustomizer, - thisArg?: any - ): TResult; - - /** - * @see _.assign - */ - extend(object: TObject): TObject; - - /** - * @see _.assign - */ - extend( - object: TObject, ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.assign - */ - extend( - source: TSource, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashImplicitObjectWrapper; - - /** - * @see assign - */ - extend( - source1: TSource1, - source2: TSource2, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashImplicitObjectWrapper; - - /** - * @see assign - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashImplicitObjectWrapper; - - /** - * @see assign - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashImplicitObjectWrapper; - - /** - * @see _.assign - */ - extend(): LoDashImplicitObjectWrapper; - - /** - * @see _.assign - */ - extend(...otherArgs: any[]): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.assign - */ - extend( - source: TSource, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashExplicitObjectWrapper; - - /** - * @see assign - */ - extend( - source1: TSource1, - source2: TSource2, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashExplicitObjectWrapper; - - /** - * @see assign - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashExplicitObjectWrapper; - - /** - * @see assign - */ - extend( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer?: AssignCustomizer, - thisArg?: any - ): LoDashExplicitObjectWrapper; - - /** - * @see _.assign - */ - extend(): LoDashExplicitObjectWrapper; - - /** - * @see _.assign - */ - extend(...otherArgs: any[]): LoDashExplicitObjectWrapper; - } - - //_.findKey - interface LoDashStatic { - /** - * This method is like _.find except that it returns the key of the first element predicate returns truthy for - * instead of the element itself. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - findKey( - object: TObject, - predicate?: DictionaryIterator, - thisArg?: any - ): string; - - /** - * @see _.findKey - */ - findKey( - object: TObject, - predicate?: ObjectIterator, - thisArg?: any - ): string; - - /** - * @see _.findKey - */ - findKey( - object: TObject, - predicate?: string, - thisArg?: any - ): string; - - /** - * @see _.findKey - */ - findKey, TObject>( - object: TObject, - predicate?: TWhere - ): string; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.findKey - */ - findKey( - predicate?: DictionaryIterator, - thisArg?: any - ): string; - - /** - * @see _.findKey - */ - findKey( - predicate?: ObjectIterator, - thisArg?: any - ): string; - - /** - * @see _.findKey - */ - findKey( - predicate?: string, - thisArg?: any - ): string; - - /** - * @see _.findKey - */ - findKey>( - predicate?: TWhere - ): string; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.findKey - */ - findKey( - predicate?: DictionaryIterator, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.findKey - */ - findKey( - predicate?: ObjectIterator, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.findKey - */ - findKey( - predicate?: string, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.findKey - */ - findKey>( - predicate?: TWhere - ): LoDashExplicitWrapper; - } - - //_.findLastKey - interface LoDashStatic { - /** - * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * - * @param object The object to search. - * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. - * @return Returns the key of the matched element, else undefined. - */ - findLastKey( - object: TObject, - predicate?: DictionaryIterator, - thisArg?: any - ): string; - - /** - * @see _.findLastKey - */ - findLastKey( - object: TObject, - predicate?: ObjectIterator, - thisArg?: any - ): string; - - /** - * @see _.findLastKey - */ - findLastKey( - object: TObject, - predicate?: string, - thisArg?: any - ): string; - - /** - * @see _.findLastKey - */ - findLastKey, TObject>( - object: TObject, - predicate?: TWhere - ): string; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.findLastKey - */ - findLastKey( - predicate?: DictionaryIterator, - thisArg?: any - ): string; - - /** - * @see _.findLastKey - */ - findLastKey( - predicate?: ObjectIterator, - thisArg?: any - ): string; - - /** - * @see _.findLastKey - */ - findLastKey( - predicate?: string, - thisArg?: any - ): string; - - /** - * @see _.findLastKey - */ - findLastKey>( - predicate?: TWhere - ): string; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.findLastKey - */ - findLastKey( - predicate?: DictionaryIterator, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.findLastKey - */ - findLastKey( - predicate?: ObjectIterator, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.findLastKey - */ - findLastKey( - predicate?: string, - thisArg?: any - ): LoDashExplicitWrapper; - - /** - * @see _.findLastKey - */ - findLastKey>( - predicate?: TWhere - ): LoDashExplicitWrapper; - } - - //_.forIn - interface LoDashStatic { - /** - * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may - * exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forIn( - object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.forIn - */ - forIn( - object: T, - iteratee?: ObjectIterator, - thisArg?: any - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forIn - */ - forIn( - iteratee?: DictionaryIterator, - thisArg?: any - ): _.LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forIn - */ - forIn( - iteratee?: DictionaryIterator, - thisArg?: any - ): _.LoDashExplicitObjectWrapper; - } - - //_.forInRight - interface LoDashStatic { - /** - * This method is like _.forIn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forInRight( - object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.forInRight - */ - forInRight( - object: T, - iteratee?: ObjectIterator, - thisArg?: any - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forInRight - */ - forInRight( - iteratee?: DictionaryIterator, - thisArg?: any - ): _.LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forInRight - */ - forInRight( - iteratee?: DictionaryIterator, - thisArg?: any - ): _.LoDashExplicitObjectWrapper; - } - - //_.forOwn - interface LoDashStatic { - /** - * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forOwn( - object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.forOwn - */ - forOwn( - object: T, - iteratee?: ObjectIterator, - thisArg?: any - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forOwn - */ - forOwn( - iteratee?: DictionaryIterator, - thisArg?: any - ): _.LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forOwn - */ - forOwn( - iteratee?: DictionaryIterator, - thisArg?: any - ): _.LoDashExplicitObjectWrapper; - } - - //_.forOwnRight - interface LoDashStatic { - /** - * This method is like _.forOwn except that it iterates over properties of object in the opposite order. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns object. - */ - forOwnRight( - object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.forOwnRight - */ - forOwnRight( - object: T, - iteratee?: ObjectIterator, - thisArg?: any - ): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.forOwnRight - */ - forOwnRight( - iteratee?: DictionaryIterator, - thisArg?: any - ): _.LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.forOwnRight - */ - forOwnRight( - iteratee?: DictionaryIterator, - thisArg?: any - ): _.LoDashExplicitObjectWrapper; - } - - //_.functions - interface LoDashStatic { - /** - * Creates an array of function property names from own enumerable properties - * of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] - */ - functions(object: any): string[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.functions - */ - functions(): _.LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.functions - */ - functions(): _.LoDashExplicitArrayWrapper; - } - - //_.functionsIn - interface LoDashStatic { - /** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] - */ - functionsIn(object: any): string[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.functionsIn - */ - functionsIn(): _.LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.functionsIn - */ - functionsIn(): _.LoDashExplicitArrayWrapper; - } - - //_.get - interface LoDashStatic { - /** - * Gets the property value at path of object. If the resolved value is undefined the defaultValue is used - * in its place. - * - * @param object The object to query. - * @param path The path of the property to get. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - get( - object: TObject, - path: StringRepresentable|StringRepresentable[], - defaultValue?: TResult - ): TResult; - - /** - * @see _.get - */ - get( - object: any, - path: StringRepresentable|StringRepresentable[], - defaultValue?: TResult - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.get - */ - get( - path: StringRepresentable|StringRepresentable[], - defaultValue?: TResult - ): TResult; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.get - */ - get( - path: StringRepresentable|StringRepresentable[], - defaultValue?: TResult - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.get - */ - get( - path: StringRepresentable|StringRepresentable[], - defaultValue?: TResult - ): TResult; - } - - interface LoDashExplicitWrapper { - /** - * @see _.get - */ - get( - path: StringRepresentable|StringRepresentable[], - defaultValue?: any - ): TResultWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.get - */ - get( - path: StringRepresentable|StringRepresentable[], - defaultValue?: any - ): TResultWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.get - */ - get( - path: StringRepresentable|StringRepresentable[], - defaultValue?: any - ): TResultWrapper; - } - - //_.has - interface LoDashStatic { - /** - * Checks if `path` is a direct property of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - has( - object: T, - path: StringRepresentable|StringRepresentable[] - ): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.has - */ - has(path: StringRepresentable|StringRepresentable[]): boolean; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.has - */ - has(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper; - } - - //_.hasIn - interface LoDashStatic { - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - hasIn( - object: T, - path: StringRepresentable|StringRepresentable[] - ): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.hasIn - */ - hasIn(path: StringRepresentable|StringRepresentable[]): boolean; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.hasIn - */ - hasIn(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper; - } - - //_.invert - interface LoDashStatic { - /** - * Creates an object composed of the inverted keys and values of object. If object contains duplicate values, - * subsequent values overwrite property assignments of previous values unless multiValue is true. - * - * @param object The object to invert. - * @param multiValue Allow multiple values per key. - * @return Returns the new inverted object. - */ - invert( - object: T, - multiValue?: boolean - ): TResult; - - /** - * @see _.invert - */ - invert( - object: Object, - multiValue?: boolean - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.invert - */ - invert(multiValue?: boolean): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.invert - */ - invert(multiValue?: boolean): LoDashExplicitObjectWrapper; - } - - //_.inverBy - interface InvertByIterator { - (value: T): any; - } - - interface LoDashStatic { - /** - * This method is like _.invert except that the inverted object is generated from the results of running each - * element of object through iteratee. The corresponding inverted value of each inverted key is an array of - * keys responsible for generating the inverted value. The iteratee is invoked with one argument: (value). - * - * @param object The object to invert. - * @param interatee The iteratee invoked per element. - * @return Returns the new inverted object. - */ - invertBy( - object: Object, - interatee?: InvertByIterator|string - ): Dictionary; - - /** - * @see _.invertBy - */ - invertBy( - object: _.Dictionary|_.NumericDictionary, - interatee?: InvertByIterator|string - ): Dictionary; - - /** - * @see _.invertBy - */ - invertBy( - object: Object, - interatee?: W - ): Dictionary; - - /** - * @see _.invertBy - */ - invertBy( - object: _.Dictionary, - interatee?: W - ): Dictionary; - } - - interface LoDashImplicitWrapper { - /** - * @see _.invertBy - */ - invertBy( - interatee?: InvertByIterator - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.invertBy - */ - invertBy( - interatee?: InvertByIterator|string - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.invertBy - */ - invertBy( - interatee?: W - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.invertBy - */ - invertBy( - interatee?: InvertByIterator|string - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.invertBy - */ - invertBy( - interatee?: W - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.invertBy - */ - invertBy( - interatee?: InvertByIterator - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.invertBy - */ - invertBy( - interatee?: InvertByIterator|string - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.invertBy - */ - invertBy( - interatee?: W - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.invertBy - */ - invertBy( - interatee?: InvertByIterator|string - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.invertBy - */ - invertBy( - interatee?: W - ): LoDashExplicitObjectWrapper>; - } - - //_.keys - interface LoDashStatic { - /** - * Creates an array of the own enumerable property names of object. - * - * Note: Non-object values are coerced to objects. See the ES spec for more details. - * - * @param object The object to query. - * @return Returns the array of property names. - */ - keys(object?: any): string[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.keys - */ - keys(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.keys - */ - keys(): LoDashExplicitArrayWrapper; - } - - //_.keysIn - interface LoDashStatic { - /** - * Creates an array of the own and inherited enumerable property names of object. - * - * Note: Non-object values are coerced to objects. - * - * @param object The object to query. - * @return An array of property names. - */ - keysIn(object?: any): string[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.keysIn - */ - keysIn(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.keysIn - */ - keysIn(): LoDashExplicitArrayWrapper; - } - - //_.mapKeys - interface LoDashStatic { - /** - * The opposite of _.mapValues; this method creates an object with the same values as object and keys generated - * by running each own enumerable property of object through iteratee. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. - * @return Returns the new mapped object. - */ - mapKeys( - object: List, - iteratee?: ListIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.mapKeys - */ - mapKeys( - object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any - ): Dictionary; - - /** - * @see _.mapKeys - */ - mapKeys( - object: List|Dictionary, - iteratee?: TObject - ): Dictionary; - - /** - * @see _.mapKeys - */ - mapKeys( - object: List|Dictionary, - iteratee?: string, - thisArg?: any - ): Dictionary; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: ListIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: TObject - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: string, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: TObject - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: string, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: ListIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: TObject - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: string, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: TObject - ): LoDashExplicitObjectWrapper>; - - /** - * @see _.mapKeys - */ - mapKeys( - iteratee?: string, - thisArg?: any - ): LoDashExplicitObjectWrapper>; - } - - //_.mapValues - interface LoDashStatic { - /** - * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. - * - * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. - * @param {Object} [thisArg] The `this` binding of `iteratee`. - * @return {Object} Returns the new mapped object. - */ - mapValues(obj: Dictionary, callback: ObjectIterator, thisArg?: any): Dictionary; - mapValues(obj: Dictionary, where: Dictionary): Dictionary; - mapValues(obj: T, pluck: string): TMapped; - mapValues(obj: T, callback: ObjectIterator, thisArg?: any): T; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.mapValues - * TValue is the type of the property values of T. - * TResult is the type output by the ObjectIterator function - */ - mapValues(callback: ObjectIterator, thisArg?: any): LoDashImplicitObjectWrapper>; - - /** - * @see _.mapValues - * TResult is the type of the property specified by pluck. - * T should be a Dictionary> - */ - mapValues(pluck: string): LoDashImplicitObjectWrapper>; - - /** - * @see _.mapValues - * TResult is the type of the properties on the object specified by pluck. - * T should be a Dictionary>> - */ - mapValues(pluck: string, where: Dictionary): LoDashImplicitArrayWrapper>; - - /** - * @see _.mapValues - * TResult is the type of the properties of each object in the values of T - * T should be a Dictionary> - */ - mapValues(where: Dictionary): LoDashImplicitArrayWrapper; - } - - //_.merge - interface LoDashStatic { - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - merge( - object: TObject, - source: TSource - ): TObject & TSource; - - /** - * @see _.merge - */ - merge( - object: TObject, - source1: TSource1, - source2: TSource2 - ): TObject & TSource1 & TSource2; - - /** - * @see _.merge - */ - merge( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see _.merge - */ - merge( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.merge - */ - merge( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.merge - */ - merge( - source: TSource - ): LoDashImplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashImplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - ...otherArgs: any[] - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.merge - */ - merge( - source: TSource - ): LoDashExplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2 - ): LoDashExplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashExplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - ): LoDashExplicitObjectWrapper; - - /** - * @see _.merge - */ - merge( - ...otherArgs: any[] - ): LoDashExplicitObjectWrapper; - } - - //_.mergeWith - interface MergeWithCustomizer { - (value: any, srcValue: any, key?: string, object?: Object, source?: Object): any; - } - - interface LoDashStatic { - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} customizer The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - mergeWith( - object: TObject, - source: TSource, - customizer: MergeWithCustomizer - ): TObject & TSource; - - /** - * @see _.mergeWith - */ - mergeWith( - object: TObject, - source1: TSource1, - source2: TSource2, - customizer: MergeWithCustomizer - ): TObject & TSource1 & TSource2; - - /** - * @see _.mergeWith - */ - mergeWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: MergeWithCustomizer - ): TObject & TSource1 & TSource2 & TSource3; - - /** - * @see _.mergeWith - */ - mergeWith( - object: TObject, - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: MergeWithCustomizer - ): TObject & TSource1 & TSource2 & TSource3 & TSource4; - - /** - * @see _.mergeWith - */ - mergeWith( - object: any, - ...otherArgs: any[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.mergeWith - */ - mergeWith( - source: TSource, - customizer: MergeWithCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - source1: TSource1, - source2: TSource2, - customizer: MergeWithCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - customizer: MergeWithCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4, - customizer: MergeWithCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.mergeWith - */ - mergeWith( - ...otherArgs: any[] - ): LoDashImplicitObjectWrapper; - } - - //_.omit - interface LoDashStatic { - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [props] The property names to omit, specified - * individually or in arrays.. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - - omit( - object: T, - ...predicate: (StringRepresentable|StringRepresentable[])[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - - /** - * @see _.omit - */ - omit( - ...predicate: (StringRepresentable|StringRepresentable[])[] - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - - /** - * @see _.omit - */ - omit( - ...predicate: (StringRepresentable|StringRepresentable[])[] - ): LoDashExplicitObjectWrapper; - } - - //_.omitBy - interface LoDashStatic { - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - omitBy( - object: T, - predicate: ObjectIterator - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.omitBy - */ - omitBy( - predicate: ObjectIterator - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.omitBy - */ - omitBy( - predicate: ObjectIterator - ): LoDashExplicitObjectWrapper; - } - - //_.pick - interface LoDashStatic { - /** - * Creates an object composed of the picked `object` properties. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [props] The property names to pick, specified - * individually or in arrays. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - pick( - object: T, - ...predicate: (StringRepresentable|StringRepresentable[])[] - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.pick - */ - pick( - ...predicate: (StringRepresentable|StringRepresentable[])[] - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.pick - */ - pick( - ...predicate: (StringRepresentable|StringRepresentable[])[] - ): LoDashExplicitObjectWrapper; - } - - //_.pickBy - interface LoDashStatic { - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - pickBy( - object: T, - predicate: ObjectIterator - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.pickBy - */ - pickBy( - predicate: ObjectIterator - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.pickBy - */ - pickBy( - predicate: ObjectIterator - ): LoDashExplicitObjectWrapper; - } - - //_.result - interface LoDashStatic { - /** - * This method is like _.get except that if the resolved value is a function it’s invoked with the this binding - * of its parent object and its result is returned. - * - * @param object The object to query. - * @param path The path of the property to resolve. - * @param defaultValue The value returned if the resolved value is undefined. - * @return Returns the resolved value. - */ - result( - object: TObject, - path: StringRepresentable|StringRepresentable[], - defaultValue?: TResult|((...args: any[]) => TResult) - ): TResult; - - /** - * @see _.result - */ - result( - object: any, - path: StringRepresentable|StringRepresentable[], - defaultValue?: TResult|((...args: any[]) => TResult) - ): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.result - */ - result( - path: StringRepresentable|StringRepresentable[], - defaultValue?: TResult|((...args: any[]) => TResult) - ): TResult; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.result - */ - result( - path: StringRepresentable|StringRepresentable[], - defaultValue?: TResult|((...args: any[]) => TResult) - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.result - */ - result( - path: StringRepresentable|StringRepresentable[], - defaultValue?: TResult|((...args: any[]) => TResult) - ): TResult; - } - - interface LoDashExplicitWrapper { - /** - * @see _.result - */ - result( - path: StringRepresentable|StringRepresentable[], - defaultValue?: any - ): TResultWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.result - */ - result( - path: StringRepresentable|StringRepresentable[], - defaultValue?: any - ): TResultWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.result - */ - result( - path: StringRepresentable|StringRepresentable[], - defaultValue?: any - ): TResultWrapper; - } - - //_.set - interface LoDashStatic { - /** - * Sets the value at path of object. If a portion of path doesn’t exist it’s created. Arrays are created for - * missing index properties while objects are created for all other missing properties. Use _.setWith to - * customize path creation. - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @return Returns object. - */ - set( - object: Object, - path: StringRepresentable|StringRepresentable[], - value: any - ): TResult; - - /** - * @see _.set - */ - set( - object: Object, - path: StringRepresentable|StringRepresentable[], - value: V - ): TResult; - - /** - * @see _.set - */ - set( - object: O, - path: StringRepresentable|StringRepresentable[], - value: V - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.set - */ - set( - path: StringRepresentable|StringRepresentable[], - value: any - ): LoDashImplicitObjectWrapper; - - /** - * @see _.set - */ - set( - path: StringRepresentable|StringRepresentable[], - value: V - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.set - */ - set( - path: StringRepresentable|StringRepresentable[], - value: any - ): LoDashExplicitObjectWrapper; - - /** - * @see _.set - */ - set( - path: StringRepresentable|StringRepresentable[], - value: V - ): LoDashExplicitObjectWrapper; - } - - //_.setWith - interface SetWithCustomizer { - (nsValue: any, key: string, nsObject: T): any; - } - - interface LoDashStatic { - /** - * This method is like _.set except that it accepts customizer which is invoked to produce the objects of - * path. If customizer returns undefined path creation is handled by the method instead. The customizer is - * invoked with three arguments: (nsValue, key, nsObject). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param value The value to set. - * @parem customizer The function to customize assigned values. - * @return Returns object. - */ - setWith( - object: Object, - path: StringRepresentable|StringRepresentable[], - value: any, - customizer?: SetWithCustomizer - ): TResult; - - /** - * @see _.setWith - */ - setWith( - object: Object, - path: StringRepresentable|StringRepresentable[], - value: V, - customizer?: SetWithCustomizer - ): TResult; - - /** - * @see _.setWith - */ - setWith( - object: O, - path: StringRepresentable|StringRepresentable[], - value: V, - customizer?: SetWithCustomizer - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.setWith - */ - setWith( - path: StringRepresentable|StringRepresentable[], - value: any, - customizer?: SetWithCustomizer - ): LoDashImplicitObjectWrapper; - - /** - * @see _.setWith - */ - setWith( - path: StringRepresentable|StringRepresentable[], - value: V, - customizer?: SetWithCustomizer - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.setWith - */ - setWith( - path: StringRepresentable|StringRepresentable[], - value: any, - customizer?: SetWithCustomizer - ): LoDashExplicitObjectWrapper; - - /** - * @see _.setWith - */ - setWith( - path: StringRepresentable|StringRepresentable[], - value: V, - customizer?: SetWithCustomizer - ): LoDashExplicitObjectWrapper; - } - - //_.toPairs - interface LoDashStatic { - /** - * Creates an array of own enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - toPairs(object?: T): any[][]; - - toPairs(object?: T): TResult[][]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.toPairs - */ - toPairs(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.toPairs - */ - toPairs(): LoDashExplicitArrayWrapper; - } - - //_.toPairsIn - interface LoDashStatic { - /** - * Creates an array of own and inherited enumerable key-value pairs for object. - * - * @param object The object to query. - * @return Returns the new array of key-value pairs. - */ - toPairsIn(object?: T): any[][]; - - toPairsIn(object?: T): TResult[][]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.toPairsIn - */ - toPairsIn(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.toPairsIn - */ - toPairsIn(): LoDashExplicitArrayWrapper; - } - - //_.transform - interface LoDashStatic { - /** - * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of - * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, - * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. - * - * @param object The object to iterate over. - * @param iteratee The function invoked per iteration. - * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. - * @return Returns the accumulated value. - */ - transform( - object: T[], - iteratee?: MemoVoidArrayIterator, - accumulator?: TResult[], - thisArg?: any - ): TResult[]; - - /** - * @see _.transform - */ - transform( - object: T[], - iteratee?: MemoVoidArrayIterator>, - accumulator?: Dictionary, - thisArg?: any - ): Dictionary; - - /** - * @see _.transform - */ - transform( - object: Dictionary, - iteratee?: MemoVoidDictionaryIterator>, - accumulator?: Dictionary, - thisArg?: any - ): Dictionary; - - /** - * @see _.transform - */ - transform( - object: Dictionary, - iteratee?: MemoVoidDictionaryIterator, - accumulator?: TResult[], - thisArg?: any - ): TResult[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.transform - */ - transform( - iteratee?: MemoVoidArrayIterator, - accumulator?: TResult[], - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.transform - */ - transform( - iteratee?: MemoVoidArrayIterator>, - accumulator?: Dictionary, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.transform - */ - transform( - iteratee?: MemoVoidDictionaryIterator>, - accumulator?: Dictionary, - thisArg?: any - ): LoDashImplicitObjectWrapper>; - - /** - * @see _.transform - */ - transform( - iteratee?: MemoVoidDictionaryIterator, - accumulator?: TResult[], - thisArg?: any - ): LoDashImplicitArrayWrapper; - } - - //_.unset - interface LoDashStatic { - /** - * Removes the property at path of object. - * - * Note: This method mutates object. - * - * @param object The object to modify. - * @param path The path of the property to unset. - * @return Returns true if the property is deleted, else false. - */ - unset( - object: T, - path: StringRepresentable|StringRepresentable[] - ): boolean; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.unset - */ - unset(path: StringRepresentable|StringRepresentable[]): LoDashImplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.unset - */ - unset(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper; - } - - //_.update - interface LoDashStatic { - /** - * This method is like _.set except that accepts updater to produce the value to set. Use _.updateWith to - * customize path creation. The updater is invoked with one argument: (value). - * - * @param object The object to modify. - * @param path The path of the property to set. - * @param updater The function to produce the updated value. - * @return Returns object. - */ - update( - object: Object, - path: StringRepresentable|StringRepresentable[], - updater: Function - ): TResult; - - /** - * @see _.update - */ - update( - object: Object, - path: StringRepresentable|StringRepresentable[], - updater: U - ): TResult; - - /** - * @see _.update - */ - update( - object: O, - path: StringRepresentable|StringRepresentable[], - updater: Function - ): TResult; - - /** - * @see _.update - */ - update( - object: O, - path: StringRepresentable|StringRepresentable[], - updater: U - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.update - */ - update( - path: StringRepresentable|StringRepresentable[], - updater: any - ): LoDashImplicitObjectWrapper; - - /** - * @see _.update - */ - update( - path: StringRepresentable|StringRepresentable[], - updater: U - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.update - */ - update( - path: StringRepresentable|StringRepresentable[], - updater: any - ): LoDashExplicitObjectWrapper; - - /** - * @see _.update - */ - update( - path: StringRepresentable|StringRepresentable[], - updater: U - ): LoDashExplicitObjectWrapper; - } - - //_.values - interface LoDashStatic { - /** - * Creates an array of the own enumerable property values of object. - * - * @param object The object to query. - * @return Returns an array of property values. - */ - values(object?: any): T[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.values - */ - values(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.values - */ - values(): LoDashExplicitArrayWrapper; - } - - //_.valuesIn - interface LoDashStatic { - /** - * Creates an array of the own and inherited enumerable property values of object. - * - * @param object The object to query. - * @return Returns the array of property values. - */ - valuesIn(object?: any): T[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.valuesIn - */ - valuesIn(): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.valuesIn - */ - valuesIn(): LoDashExplicitArrayWrapper; - } - - /********** - * String * - **********/ - - //_.camelCase - interface LoDashStatic { - /** - * Converts string to camel case. - * - * @param string The string to convert. - * @return Returns the camel cased string. - */ - camelCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.camelCase - */ - camelCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.camelCase - */ - camelCase(): LoDashExplicitWrapper; - } - - //_.capitalize - interface LoDashStatic { - /** - * Converts the first character of string to upper case and the remaining to lower case. - * - * @param string The string to capitalize. - * @return Returns the capitalized string. - */ - capitalize(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.capitalize - */ - capitalize(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.capitalize - */ - capitalize(): LoDashExplicitWrapper; - } - - //_.deburr - interface LoDashStatic { - /** - * Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining - * diacritical marks. - * - * @param string The string to deburr. - * @return Returns the deburred string. - */ - deburr(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.deburr - */ - deburr(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.deburr - */ - deburr(): LoDashExplicitWrapper; - } - - //_.endsWith - interface LoDashStatic { - /** - * Checks if string ends with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string ends with target, else false. - */ - endsWith( - string?: string, - target?: string, - position?: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.endsWith - */ - endsWith( - target?: string, - position?: number - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.endsWith - */ - endsWith( - target?: string, - position?: number - ): LoDashExplicitWrapper; - } - - // _.escape - interface LoDashStatic { - /** - * Converts the characters "&", "<", ">", '"', "'", and "`" in string to their corresponding HTML entities. - * - * Note: No other characters are escaped. To escape additional characters use a third-party library like he. - * - * hough the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML - * and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s - * article (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in IE < 9, they can break out of attribute values or HTML comments. See #59, - * #102, #108, and #133 of the HTML5 Security Cheatsheet for more details. - * - * When working with HTML you should always quote attribute values to reduce XSS vectors. - * - * @param string The string to escape. - * @return Returns the escaped string. - */ - escape(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.escape - */ - escape(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.escape - */ - escape(): LoDashExplicitWrapper; - } - - // _.escapeRegExp - interface LoDashStatic { - /** - * Escapes the RegExp special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", - * "{", "}", and "|" in string. - * - * @param string The string to escape. - * @return Returns the escaped string. - */ - escapeRegExp(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.escapeRegExp - */ - escapeRegExp(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.escapeRegExp - */ - escapeRegExp(): LoDashExplicitWrapper; - } - - //_.kebabCase - interface LoDashStatic { - /** - * Converts string to kebab case. - * - * @param string The string to convert. - * @return Returns the kebab cased string. - */ - kebabCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.kebabCase - */ - kebabCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.kebabCase - */ - kebabCase(): LoDashExplicitWrapper; - } - - //_.lowerCase - interface LoDashStatic { - /** - * Converts `string`, as space separated words, to lower case. - * - * @param string The string to convert. - * @return Returns the lower cased string. - */ - lowerCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.lowerCase - */ - lowerCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.lowerCase - */ - lowerCase(): LoDashExplicitWrapper; - } - - //_.lowerFirst - interface LoDashStatic { - /** - * Converts the first character of `string` to lower case. - * - * @param string The string to convert. - * @return Returns the converted string. - */ - lowerFirst(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.lowerFirst - */ - lowerFirst(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.lowerFirst - */ - lowerFirst(): LoDashExplicitWrapper; - } - - //_.pad - interface LoDashStatic { - /** - * Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if - * they can’t be evenly divided by length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - pad( - string?: string, - length?: number, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.pad - */ - pad( - length?: number, - chars?: string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.pad - */ - pad( - length?: number, - chars?: string - ): LoDashExplicitWrapper; - } - - //_.padEnd - interface LoDashStatic { - /** - * Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - padEnd( - string?: string, - length?: number, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.padEnd - */ - padEnd( - length?: number, - chars?: string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.padEnd - */ - padEnd( - length?: number, - chars?: string - ): LoDashExplicitWrapper; - } - - //_.padStart - interface LoDashStatic { - /** - * Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed - * length. - * - * @param string The string to pad. - * @param length The padding length. - * @param chars The string used as padding. - * @return Returns the padded string. - */ - padStart( - string?: string, - length?: number, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.padStart - */ - padStart( - length?: number, - chars?: string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.padStart - */ - padStart( - length?: number, - chars?: string - ): LoDashExplicitWrapper; - } - - //_.parseInt - interface LoDashStatic { - /** - * Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used - * unless value is a hexadecimal, in which case a radix of 16 is used. - * - * Note: This method aligns with the ES5 implementation of parseInt. - * - * @param string The string to convert. - * @param radix The radix to interpret value by. - * @return Returns the converted integer. - */ - parseInt( - string: string, - radix?: number - ): number; - } - - interface LoDashImplicitWrapper { - /** - * @see _.parseInt - */ - parseInt(radix?: number): number; - } - - interface LoDashExplicitWrapper { - /** - * @see _.parseInt - */ - parseInt(radix?: number): LoDashExplicitWrapper; - } - - //_.repeat - interface LoDashStatic { - /** - * Repeats the given string n times. - * - * @param string The string to repeat. - * @param n The number of times to repeat the string. - * @return Returns the repeated string. - */ - repeat( - string?: string, - n?: number - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.repeat - */ - repeat(n?: number): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.repeat - */ - repeat(n?: number): LoDashExplicitWrapper; - } - - //_.replace - interface LoDashStatic { - /** - * Replaces matches for pattern in string with replacement. - * - * Note: This method is based on String#replace. - * - * @param string - * @param pattern - * @param replacement - * @return Returns the modified string. - */ - replace( - string: string, - pattern: RegExp|string, - replacement: Function|string - ): string; - - /** - * @see _.replace - */ - replace( - pattern?: RegExp|string, - replacement?: Function|string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.replace - */ - replace( - pattern?: RegExp|string, - replacement?: Function|string - ): string; - - /** - * @see _.replace - */ - replace( - replacement?: Function|string - ): string; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.replace - */ - replace( - pattern?: RegExp|string, - replacement?: Function|string - ): string; - - /** - * @see _.replace - */ - replace( - replacement?: Function|string - ): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.replace - */ - replace( - pattern?: RegExp|string, - replacement?: Function|string - ): LoDashExplicitWrapper; - - /** - * @see _.replace - */ - replace( - replacement?: Function|string - ): LoDashExplicitWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.replace - */ - replace( - pattern?: RegExp|string, - replacement?: Function|string - ): LoDashExplicitWrapper; - - /** - * @see _.replace - */ - replace( - replacement?: Function|string - ): LoDashExplicitWrapper; - } - - //_.snakeCase - interface LoDashStatic { - /** - * Converts string to snake case. - * - * @param string The string to convert. - * @return Returns the snake cased string. - */ - snakeCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.snakeCase - */ - snakeCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.snakeCase - */ - snakeCase(): LoDashExplicitWrapper; - } - - //_.split - interface LoDashStatic { - /** - * Splits string by separator. - * - * Note: This method is based on String#split. - * - * @param string - * @param separator - * @param limit - * @return Returns the new array of string segments. - */ - split( - string: string, - separator?: RegExp|string, - limit?: number - ): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.split - */ - split( - separator?: RegExp|string, - limit?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.split - */ - split( - separator?: RegExp|string, - limit?: number - ): LoDashExplicitArrayWrapper; - } - - //_.startCase - interface LoDashStatic { - /** - * Converts string to start case. - * - * @param string The string to convert. - * @return Returns the start cased string. - */ - startCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.startCase - */ - startCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.startCase - */ - startCase(): LoDashExplicitWrapper; - } - - //_.startsWith - interface LoDashStatic { - /** - * Checks if string starts with the given target string. - * - * @param string The string to search. - * @param target The string to search for. - * @param position The position to search from. - * @return Returns true if string starts with target, else false. - */ - startsWith( - string?: string, - target?: string, - position?: number - ): boolean; - } - - interface LoDashImplicitWrapper { - /** - * @see _.startsWith - */ - startsWith( - target?: string, - position?: number - ): boolean; - } - - interface LoDashExplicitWrapper { - /** - * @see _.startsWith - */ - startsWith( - target?: string, - position?: number - ): LoDashExplicitWrapper; - } - - //_.template - interface TemplateOptions extends TemplateSettings { - /** - * The sourceURL of the template's compiled source. - */ - sourceURL?: string; - } - - interface TemplateExecutor { - (data?: Object): string; - source: string; - } - - interface LoDashStatic { - /** - * Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, - * HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" - * delimiters. Data properties may be accessed as free variables in the template. If a setting object is - * provided it takes precedence over _.templateSettings values. - * - * Note: In the development build _.template utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier - * debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @param string The template string. - * @param options The options object. - * @param options.escape The HTML "escape" delimiter. - * @param options.evaluate The "evaluate" delimiter. - * @param options.imports An object to import into the template as free variables. - * @param options.interpolate The "interpolate" delimiter. - * @param options.sourceURL The sourceURL of the template's compiled source. - * @param options.variable The data object variable name. - * @return Returns the compiled template function. - */ - template( - string: string, - options?: TemplateOptions - ): TemplateExecutor; - } - - interface LoDashImplicitWrapper { - /** - * @see _.template - */ - template(options?: TemplateOptions): TemplateExecutor; - } - - interface LoDashExplicitWrapper { - /** - * @see _.template - */ - template(options?: TemplateOptions): LoDashExplicitObjectWrapper; - } - - //_.toLower - interface LoDashStatic { - /** - * Converts `string`, as a whole, to lower case. - * - * @param string The string to convert. - * @return Returns the lower cased string. - */ - toLower(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toLower - */ - toLower(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toLower - */ - toLower(): LoDashExplicitWrapper; - } - - //_.toUpper - interface LoDashStatic { - /** - * Converts `string`, as a whole, to upper case. - * - * @param string The string to convert. - * @return Returns the upper cased string. - */ - toUpper(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.toUpper - */ - toUpper(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.toUpper - */ - toUpper(): LoDashExplicitWrapper; - } - - //_.trim - interface LoDashStatic { - /** - * Removes leading and trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - trim( - string?: string, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.trim - */ - trim(chars?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.trim - */ - trim(chars?: string): LoDashExplicitWrapper; - } - - //_.trimEnd - interface LoDashStatic { - /** - * Removes trailing whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - trimEnd( - string?: string, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.trimEnd - */ - trimEnd(chars?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.trimEnd - */ - trimEnd(chars?: string): LoDashExplicitWrapper; - } - - //_.trimStart - interface LoDashStatic { - /** - * Removes leading whitespace or specified characters from string. - * - * @param string The string to trim. - * @param chars The characters to trim. - * @return Returns the trimmed string. - */ - trimStart( - string?: string, - chars?: string - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.trimStart - */ - trimStart(chars?: string): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.trimStart - */ - trimStart(chars?: string): LoDashExplicitWrapper; - } - - //_.truncate - interface TruncateOptions { - /** The maximum string length. */ - length?: number; - /** The string to indicate text is omitted. */ - omission?: string; - /** The separator pattern to truncate to. */ - separator?: string|RegExp; - } - - interface LoDashStatic { - /** - * Truncates string if it’s longer than the given maximum string length. The last characters of the truncated - * string are replaced with the omission string which defaults to "…". - * - * @param string The string to truncate. - * @param options The options object or maximum string length. - * @return Returns the truncated string. - */ - truncate( - string?: string, - options?: TruncateOptions - ): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.truncate - */ - truncate(options?: TruncateOptions): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.truncate - */ - truncate(options?: TruncateOptions): LoDashExplicitWrapper; - } - - //_.unescape - interface LoDashStatic { - /** - * The inverse of _.escape; this method converts the HTML entities &, <, >, ", ', and ` - * in string to their corresponding characters. - * - * Note: No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library - * like he. - * - * @param string The string to unescape. - * @return Returns the unescaped string. - */ - unescape(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.unescape - */ - unescape(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.unescape - */ - unescape(): LoDashExplicitWrapper; - } - - //_.upperCase - interface LoDashStatic { - /** - * Converts `string`, as space separated words, to upper case. - * - * @param string The string to convert. - * @return Returns the upper cased string. - */ - upperCase(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.upperCase - */ - upperCase(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.upperCase - */ - upperCase(): LoDashExplicitWrapper; - } - - //_.upperFirst - interface LoDashStatic { - /** - * Converts the first character of `string` to upper case. - * - * @param string The string to convert. - * @return Returns the converted string. - */ - upperFirst(string?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.upperFirst - */ - upperFirst(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.upperFirst - */ - upperFirst(): LoDashExplicitWrapper; - } - - //_.words - interface LoDashStatic { - /** - * Splits `string` into an array of its words. - * - * @param string The string to inspect. - * @param pattern The pattern to match words. - * @return Returns the words of `string`. - */ - words( - string?: string, - pattern?: string|RegExp - ): string[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.words - */ - words(pattern?: string|RegExp): string[]; - } - - interface LoDashExplicitWrapper { - /** - * @see _.words - */ - words(pattern?: string|RegExp): LoDashExplicitArrayWrapper; - } - - /*********** - * Utility * - ***********/ - - //_.attempt - interface LoDashStatic { - /** - * Attempts to invoke func, returning either the result or the caught error object. Any additional arguments - * are provided to func when it’s invoked. - * - * @param func The function to attempt. - * @return Returns the func result or error object. - */ - attempt(func: (...args: any[]) => TResult, ...args: any[]): TResult|Error; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.attempt - */ - attempt(...args: any[]): TResult|Error; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.attempt - */ - attempt(...args: any[]): LoDashExplicitObjectWrapper; - } - - //_.constant - interface LoDashStatic { - /** - * Creates a function that returns value. - * - * @param value The value to return from the new function. - * @return Returns the new function. - */ - constant(value: T): () => T; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.constant - */ - constant(): LoDashImplicitObjectWrapper<() => TResult>; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.constant - */ - constant(): LoDashExplicitObjectWrapper<() => TResult>; - } - - //_.identity - interface LoDashStatic { - /** - * This method returns the first argument provided to it. - * - * @param value Any value. - * @return Returns value. - */ - identity(value?: T): T; - } - - interface LoDashImplicitWrapper { - /** - * @see _.identity - */ - identity(): T; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.identity - */ - identity(): T[]; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.identity - */ - identity(): T; - } - - interface LoDashExplicitWrapper { - /** - * @see _.identity - */ - identity(): LoDashExplicitWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.identity - */ - identity(): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.identity - */ - identity(): LoDashExplicitObjectWrapper; - } - - //_.iteratee - interface LoDashStatic { - /** - * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created callback returns the - * property value for a given element. If `func` is an object the created - * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. - * - * @static - * @memberOf _ - * @category Util - * @param {*} [func=_.identity] The value to convert to a callback. - * @returns {Function} Returns the callback. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // create custom iteratee shorthands - * _.iteratee = _.wrap(_.iteratee, function(callback, func) { - * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); - * return !p ? callback(func) : function(object) { - * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); - * }; - * }); - * - * _.filter(users, 'age > 36'); - * // => [{ 'user': 'fred', 'age': 40 }] - */ - iteratee( - func: Function, - thisArg?: any - ): (...args: any[]) => TResult; - - /** - * @see _.iteratee - */ - iteratee( - func: string, - thisArg?: any - ): (object: any) => TResult; - - /** - * @see _.iteratee - */ - iteratee( - func: Object, - thisArg?: any - ): (object: any) => boolean; - - /** - * @see _.iteratee - */ - iteratee(): (value: TResult) => TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.iteratee - */ - iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => TResult>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.iteratee - */ - iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => boolean>; - - /** - * @see _.iteratee - */ - iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.iteratee - */ - iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => TResult>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.iteratee - */ - iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => boolean>; - - /** - * @see _.iteratee - */ - iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; - } - - //_.matches - interface LoDashStatic { - /** - * Creates a function that performs a deep comparison between a given object and source, returning true if the - * given object has equivalent property values, else false. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. For comparing a single own - * or inherited property value see _.matchesProperty. - * - * @param source The object of property values to match. - * @return Returns the new function. - */ - matches(source: T): (value: any) => boolean; - - /** - * @see _.matches - */ - matches(source: T): (value: V) => boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.matches - */ - matches(): LoDashImplicitObjectWrapper<(value: V) => boolean>; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.matches - */ - matches(): LoDashExplicitObjectWrapper<(value: V) => boolean>; - } - - //_.matchesProperty - interface LoDashStatic { - /** - * Creates a function that compares the property value of path on a given object to value. - * - * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and - * strings. Objects are compared by their own, not inherited, enumerable properties. - * - * @param path The path of the property to get. - * @param srcValue The value to match. - * @return Returns the new function. - */ - matchesProperty( - path: StringRepresentable|StringRepresentable[], - srcValue: T - ): (value: any) => boolean; - - /** - * @see _.matchesProperty - */ - matchesProperty( - path: StringRepresentable|StringRepresentable[], - srcValue: T - ): (value: V) => boolean; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashImplicitObjectWrapper<(value: any) => boolean>; - - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashImplicitObjectWrapper<(value: Value) => boolean>; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashExplicitObjectWrapper<(value: any) => boolean>; - - /** - * @see _.matchesProperty - */ - matchesProperty( - srcValue: SrcValue - ): LoDashExplicitObjectWrapper<(value: Value) => boolean>; - } - - //_.method - interface LoDashStatic { - /** - * Creates a function that invokes the method at path on a given object. Any additional arguments are provided - * to the invoked method. - * - * @param path The path of the method to invoke. - * @param args The arguments to invoke the method with. - * @return Returns the new function. - */ - method( - path: string|StringRepresentable[], - ...args: any[] - ): (object: TObject) => TResult; - - /** - * @see _.method - */ - method( - path: string|StringRepresentable[], - ...args: any[] - ): (object: any) => TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.method - */ - method(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>; - - /** - * @see _.method - */ - method(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.method - */ - method(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>; - - /** - * @see _.method - */ - method(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.method - */ - method(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>; - - /** - * @see _.method - */ - method(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.method - */ - method(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>; - - /** - * @see _.method - */ - method(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>; - } - - //_.methodOf - interface LoDashStatic { - /** - * The opposite of _.method; this method creates a function that invokes the method at a given path on object. - * Any additional arguments are provided to the invoked method. - * - * @param object The object to query. - * @param args The arguments to invoke the method with. - * @return Returns the new function. - */ - methodOf( - object: TObject, - ...args: any[] - ): (path: StringRepresentable|StringRepresentable[]) => TResult; - - /** - * @see _.methodOf - */ - methodOf( - object: {}, - ...args: any[] - ): (path: StringRepresentable|StringRepresentable[]) => TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.methodOf - */ - methodOf( - ...args: any[] - ): LoDashImplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.methodOf - */ - methodOf( - ...args: any[] - ): LoDashExplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>; - } - - //_.mixin - interface MixinOptions { - chain?: boolean; - } - - interface LoDashStatic { - /** - * Adds all own enumerable function properties of a source object to the destination object. If object is a - * function then methods are added to its prototype as well. - * - * Note: Use _.runInContext to create a pristine lodash function to avoid conflicts caused by modifying - * the original. - * - * @param object The destination object. - * @param source The object of functions to add. - * @param options The options object. - * @param options.chain Specify whether the functions added are chainable. - * @return Returns object. - */ - mixin( - object: TObject, - source: Dictionary, - options?: MixinOptions - ): TResult; - - /** - * @see _.mixin - */ - mixin( - source: Dictionary, - options?: MixinOptions - ): TResult; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.mixin - */ - mixin( - source: Dictionary, - options?: MixinOptions - ): LoDashImplicitObjectWrapper; - - /** - * @see _.mixin - */ - mixin( - options?: MixinOptions - ): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.mixin - */ - mixin( - source: Dictionary, - options?: MixinOptions - ): LoDashExplicitObjectWrapper; - - /** - * @see _.mixin - */ - mixin( - options?: MixinOptions - ): LoDashExplicitObjectWrapper; - } - - //_.noConflict - interface LoDashStatic { - /** - * Reverts the _ variable to its previous value and returns a reference to the lodash function. - * - * @return Returns the lodash function. - */ - noConflict(): typeof _; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.noConflict - */ - noConflict(): typeof _; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.noConflict - */ - noConflict(): LoDashExplicitObjectWrapper; - } - - //_.noop - interface LoDashStatic { - /** - * A no-operation function that returns undefined regardless of the arguments it receives. - * - * @return undefined - */ - noop(...args: any[]): void; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.noop - */ - noop(...args: any[]): void; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.noop - */ - noop(...args: any[]): _.LoDashExplicitWrapper; - } - - //_.nthArg - interface LoDashStatic { - /** - * Creates a function that returns its nth argument. - * - * @param n The index of the argument to return. - * @return Returns the new function. - */ - nthArg(n?: number): TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.nthArg - */ - nthArg(): LoDashImplicitObjectWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.nthArg - */ - nthArg(): LoDashExplicitObjectWrapper; - } - - //_.over - interface LoDashStatic { - /** - * Creates a function that invokes iteratees with the arguments provided to the created function and returns - * their results. - * - * @param iteratees The iteratees to invoke. - * @return Returns the new function. - */ - over(...iteratees: (Function|Function[])[]): (...args: any[]) => TResult[]; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.over - */ - over(...iteratees: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.over - */ - over(...iteratees: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.over - */ - over(...iteratees: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.over - */ - over(...iteratees: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>; - } - - //_.overEvery - interface LoDashStatic { - /** - * Creates a function that checks if all of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - overEvery(...predicates: (Function|Function[])[]): (...args: any[]) => boolean; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.overEvery - */ - overEvery(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.overEvery - */ - overEvery(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.overEvery - */ - overEvery(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.overEvery - */ - overEvery(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; - } - - //_.overSome - interface LoDashStatic { - /** - * Creates a function that checks if any of the predicates return truthy when invoked with the arguments - * provided to the created function. - * - * @param predicates The predicates to check. - * @return Returns the new function. - */ - overSome(...predicates: (Function|Function[])[]): (...args: any[]) => boolean; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.overSome - */ - overSome(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.overSome - */ - overSome(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.overSome - */ - overSome(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.overSome - */ - overSome(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; - } - - //_.property - interface LoDashStatic { - /** - * Creates a function that returns the property value at path on a given object. - * - * @param path The path of the property to get. - * @return Returns the new function. - */ - property(path: StringRepresentable|StringRepresentable[]): (obj: TObj) => TResult; - } - - interface LoDashImplicitWrapper { - /** - * @see _.property - */ - property(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.property - */ - property(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>; - } - - interface LoDashExplicitWrapper { - /** - * @see _.property - */ - property(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.property - */ - property(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>; - } - - //_.propertyOf - interface LoDashStatic { - /** - * The opposite of _.property; this method creates a function that returns the property value at a given path - * on object. - * - * @param object The object to query. - * @return Returns the new function. - */ - propertyOf(object: T): (path: string|string[]) => any; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.propertyOf - */ - propertyOf(): LoDashImplicitObjectWrapper<(path: string|string[]) => any>; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.propertyOf - */ - propertyOf(): LoDashExplicitObjectWrapper<(path: string|string[]) => any>; - } - - //_.range - interface LoDashStatic { - /** - * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end. - * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length - * range is created unless a negative step is specified. - * - * @param start The start of the range. - * @param end The end of the range. - * @param step The value to increment or decrement by. - * @return Returns a new range array. - */ - range( - start: number, - end: number, - step?: number - ): number[]; - - /** - * @see _.range - */ - range( - end: number, - step?: number - ): number[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.range - */ - range( - end?: number, - step?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.range - */ - range( - end?: number, - step?: number - ): LoDashExplicitArrayWrapper; - } - - //_.rangeRight - interface LoDashStatic { - /** - * This method is like `_.range` except that it populates values in - * descending order. - * - * @static - * @memberOf _ - * @category Util - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @param {number} [step=1] The value to increment or decrement by. - * @returns {Array} Returns the new array of numbers. - * @example - * - * _.rangeRight(4); - * // => [3, 2, 1, 0] - * - * _.rangeRight(-4); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 5); - * // => [4, 3, 2, 1] - * - * _.rangeRight(0, 20, 5); - * // => [15, 10, 5, 0] - * - * _.rangeRight(0, -4, -1); - * // => [-3, -2, -1, 0] - * - * _.rangeRight(1, 4, 0); - * // => [1, 1, 1] - * - * _.rangeRight(0); - * // => [] - */ - rangeRight( - start: number, - end: number, - step?: number - ): number[]; - - /** - * @see _.rangeRight - */ - rangeRight( - end: number, - step?: number - ): number[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.rangeRight - */ - rangeRight( - end?: number, - step?: number - ): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.rangeRight - */ - rangeRight( - end?: number, - step?: number - ): LoDashExplicitArrayWrapper; - } - - //_.runInContext - interface LoDashStatic { - /** - * Create a new pristine lodash function using the given context object. - * - * @param context The context object. - * @return Returns a new lodash function. - */ - runInContext(context?: Object): typeof _; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.runInContext - */ - runInContext(): typeof _; - } - - //_.times - interface LoDashStatic { - /** - * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee - * is invoked with one argument; (index). - * - * @param n The number of times to invoke iteratee. - * @param iteratee The function invoked per iteration. - * @return Returns the array of results. - */ - times( - n: number, - iteratee: (num: number) => TResult - ): TResult[]; - - /** - * @see _.times - */ - times(n: number): number[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.times - */ - times( - iteratee: (num: number) => TResult - ): TResult[]; - - /** - * @see _.times - */ - times(): number[]; - } - - interface LoDashExplicitWrapper { - /** - * @see _.times - */ - times( - iteratee: (num: number) => TResult - ): LoDashExplicitArrayWrapper; - - /** - * @see _.times - */ - times(): LoDashExplicitArrayWrapper; - } - - //_.toPath - interface LoDashStatic { - /** - * Converts `value` to a property path array. - * - * @static - * @memberOf _ - * @category Util - * @param {*} value The value to convert. - * @returns {Array} Returns the new property path array. - * @example - * - * _.toPath('a.b.c'); - * // => ['a', 'b', 'c'] - * - * _.toPath('a[0].b.c'); - * // => ['a', '0', 'b', 'c'] - * - * var path = ['a', 'b', 'c'], - * newPath = _.toPath(path); - * - * console.log(newPath); - * // => ['a', 'b', 'c'] - * - * console.log(path === newPath); - * // => false - */ - toPath(value: any): string[]; - } - - interface LoDashImplicitWrapperBase { - /** - * @see _.toPath - */ - toPath(): LoDashImplicitWrapper; - } - - interface LoDashExplicitWrapperBase { - /** - * @see _.toPath - */ - toPath(): LoDashExplicitWrapper; - } - - //_.uniqueId - interface LoDashStatic { - /** - * Generates a unique ID. If prefix is provided the ID is appended to it. - * - * @param prefix The value to prefix the ID with. - * @return Returns the unique ID. - */ - uniqueId(prefix?: string): string; - } - - interface LoDashImplicitWrapper { - /** - * @see _.uniqueId - */ - uniqueId(): string; - } - - interface LoDashExplicitWrapper { - /** - * @see _.uniqueId - */ - uniqueId(): LoDashExplicitWrapper; - } - - interface ListIterator { - (value: T, index: number, collection: List): TResult; - } - - interface DictionaryIterator { - (value: T, key?: string, collection?: Dictionary): TResult; - } - - interface NumericDictionaryIterator { - (value: T, key?: number, collection?: Dictionary): TResult; - } - - interface ObjectIterator { - (element: T, key?: string, collection?: any): TResult; - } - - interface StringIterator { - (char: string, index?: number, string?: string): TResult; - } - - interface MemoVoidIterator { - (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): void; - } - interface MemoIterator { - (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): TResult; - } - - interface MemoVoidArrayIterator { - (acc: TResult, curr: T, index?: number, arr?: T[]): void; - } - interface MemoVoidDictionaryIterator { - (acc: TResult, curr: T, key?: string, dict?: Dictionary): void; - } - - //interface Collection {} - - // Common interface between Arrays and jQuery objects - interface List { - [index: number]: T; - length: number; - } - - interface Dictionary { - [index: string]: T; - } - - interface NumericDictionary { - [index: number]: T; - } - - interface StringRepresentable { - toString(): string; - } - - interface Cancelable { - cancel(): void; - } -} - -declare module "lodash" { - export = _; -} - -// Backward compatibility with --target es5 -interface Set {} -interface Map {} -interface WeakSet {} -interface WeakMap {} diff --git a/templates/yeoman/typings/minimatch/minimatch.d.ts b/templates/yeoman/typings/minimatch/minimatch.d.ts deleted file mode 100644 index 5a6c7215..00000000 --- a/templates/yeoman/typings/minimatch/minimatch.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -// Type definitions for Minimatch 2.0.8 -// Project: https://github.com/isaacs/minimatch -// Definitions by: vvakame -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare module "minimatch" { - - function M(target: string, pattern: string, options?: M.IOptions): boolean; - - namespace M { - function match(list: string[], pattern: string, options?: IOptions): string[]; - function filter(pattern: string, options?: IOptions): (element: string, indexed: number, array: string[]) => boolean; - function makeRe(pattern: string, options?: IOptions): RegExp; - - var Minimatch: IMinimatchStatic; - - interface IOptions { - debug?: boolean; - nobrace?: boolean; - noglobstar?: boolean; - dot?: boolean; - noext?: boolean; - nocase?: boolean; - nonull?: boolean; - matchBase?: boolean; - nocomment?: boolean; - nonegate?: boolean; - flipNegate?: boolean; - } - - interface IMinimatchStatic { - new (pattern: string, options?: IOptions): IMinimatch; - prototype: IMinimatch; - } - - interface IMinimatch { - pattern: string; - options: IOptions; - /** 2-dimensional array of regexp or string expressions. */ - set: any[][]; // (RegExp | string)[][] - regexp: RegExp; - negate: boolean; - comment: boolean; - empty: boolean; - - makeRe(): RegExp; // regexp or boolean - match(fname: string): boolean; - matchOne(files: string[], pattern: string[], partial: boolean): boolean; - - /** Deprecated. For internal use. */ - debug(): void; - /** Deprecated. For internal use. */ - make(): void; - /** Deprecated. For internal use. */ - parseNegate(): void; - /** Deprecated. For internal use. */ - braceExpand(pattern: string, options: IOptions): void; - /** Deprecated. For internal use. */ - parse(pattern: string, isSub?: boolean): void; - } - } - - export = M; -} diff --git a/templates/yeoman/typings/mkdirp/mkdirp.d.ts b/templates/yeoman/typings/mkdirp/mkdirp.d.ts deleted file mode 100644 index cd635ab4..00000000 --- a/templates/yeoman/typings/mkdirp/mkdirp.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Type definitions for mkdirp 0.3.0 -// Project: http://github.com/substack/node-mkdirp -// Definitions by: Bart van der Schoor -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare module 'mkdirp' { - - function mkdirp(dir: string, cb: (err: any, made: string) => void): void; - function mkdirp(dir: string, flags: any, cb: (err: any, made: string) => void): void; - - namespace mkdirp { - function sync(dir: string, flags?: any): string; - } - export = mkdirp; -} diff --git a/templates/yeoman/typings/node-uuid/node-uuid-base.d.ts b/templates/yeoman/typings/node-uuid/node-uuid-base.d.ts deleted file mode 100644 index fc59e9c7..00000000 --- a/templates/yeoman/typings/node-uuid/node-uuid-base.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Type definitions for node-uuid.js -// Project: https://github.com/broofa/node-uuid -// Definitions by: Jeff May -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** Common definitions for all environments */ -declare namespace __NodeUUID { - interface UUIDOptions { - - /** - * Node id as Array of 6 bytes (per 4.1.6). - * Default: Randomly generated ID. See note 1. - */ - node?: any[]; - - /** - * (Number between 0 - 0x3fff) RFC clock sequence. - * Default: An internally maintained clockseq is used. - */ - clockseq?: number; - - /** - * (Number | Date) Time in milliseconds since unix Epoch. - * Default: The current time is used. - */ - msecs?: number|Date; - - /** - * (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if msecs is unspecified. - * Default: internal uuid counter is used, as per 4.2.1.2. - */ - nsecs?: number; - } - - interface UUID { - v1(options?: UUIDOptions): string; - v1(options?: UUIDOptions, buffer?: number[], offset?: number): number[]; - - v4(options?: UUIDOptions): string; - v4(options?: UUIDOptions, buffer?: number[], offset?: number): number[]; - - parse(id: string, buffer?: number[], offset?: number): number[]; - - unparse(buffer: number[], offset?: number): string; - } -} diff --git a/templates/yeoman/typings/node-uuid/node-uuid-cjs.d.ts b/templates/yeoman/typings/node-uuid/node-uuid-cjs.d.ts deleted file mode 100644 index 78f75354..00000000 --- a/templates/yeoman/typings/node-uuid/node-uuid-cjs.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Type definitions for node-uuid.js -// Project: https://github.com/broofa/node-uuid -// Definitions by: Jeff May -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -/** - * Expose as CommonJS module - * For use in node environment or browser environment (using webpack or other module loaders) - */ -declare module "node-uuid" { - var uuid: __NodeUUID.UUID; - export = uuid; -} \ No newline at end of file diff --git a/templates/yeoman/typings/node-uuid/node-uuid.d.ts b/templates/yeoman/typings/node-uuid/node-uuid.d.ts deleted file mode 100644 index a6737053..00000000 --- a/templates/yeoman/typings/node-uuid/node-uuid.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Type definitions for node-uuid.js -// Project: https://github.com/broofa/node-uuid -// Definitions by: Jeff May -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// -/// -/// - -/** - * Definitions for use in node environment - * - * !! For browser enviroments, use node-uuid-global or node-uuid-cjs - */ -declare module __NodeUUID { - /** - * Overloads for node environment - * We need to duplicate some declarations because - * interface merging doesn't work with overloads - */ - interface UUID { - v1(options?: UUIDOptions): string; - v1(options?: UUIDOptions, buffer?: number[], offset?: number): number[]; - v1(options?: UUIDOptions, buffer?: Buffer, offset?: number): Buffer; - - v4(options?: UUIDOptions): string; - v4(options?: UUIDOptions, buffer?: number[], offset?: number): number[]; - v4(options?: UUIDOptions, buffer?: Buffer, offset?: number): Buffer; - - parse(id: string, buffer?: number[], offset?: number): number[]; - parse(id: string, buffer?: Buffer, offset?: number): Buffer; - - unparse(buffer: number[], offset?: number): string; - unparse(buffer: Buffer, offset?: number): string; - } -} diff --git a/templates/yeoman/typings/node/node.d.ts b/templates/yeoman/typings/node/node.d.ts deleted file mode 100644 index 6f115759..00000000 --- a/templates/yeoman/typings/node/node.d.ts +++ /dev/null @@ -1,2344 +0,0 @@ -// Type definitions for Node.js v4.x -// Project: http://nodejs.org/ -// Definitions by: Microsoft TypeScript , DefinitelyTyped -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/************************************************ -* * -* Node.js v4.x API * -* * -************************************************/ - -interface Error { - stack?: string; -} - - -// compat for TypeScript 1.8 -// if you use with --target es3 or --target es5 and use below definitions, -// use the lib.es6.d.ts that is bundled with TypeScript 1.8. -interface MapConstructor {} -interface WeakMapConstructor {} -interface SetConstructor {} -interface WeakSetConstructor {} - -/************************************************ -* * -* GLOBAL * -* * -************************************************/ -declare var process: NodeJS.Process; -declare var global: NodeJS.Global; - -declare var __filename: string; -declare var __dirname: string; - -declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; -declare function clearTimeout(timeoutId: NodeJS.Timer): void; -declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; -declare function clearInterval(intervalId: NodeJS.Timer): void; -declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; -declare function clearImmediate(immediateId: any): void; - -interface NodeRequireFunction { - (id: string): any; -} - -interface NodeRequire extends NodeRequireFunction { - resolve(id:string): string; - cache: any; - extensions: any; - main: any; -} - -declare var require: NodeRequire; - -interface NodeModule { - exports: any; - require: NodeRequireFunction; - id: string; - filename: string; - loaded: boolean; - parent: any; - children: any[]; -} - -declare var module: NodeModule; - -// Same as module.exports -declare var exports: any; -declare var SlowBuffer: { - new (str: string, encoding?: string): Buffer; - new (size: number): Buffer; - new (size: Uint8Array): Buffer; - new (array: any[]): Buffer; - prototype: Buffer; - isBuffer(obj: any): boolean; - byteLength(string: string, encoding?: string): number; - concat(list: Buffer[], totalLength?: number): Buffer; -}; - - -// Buffer class -type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "binary" | "hex"; -interface Buffer extends NodeBuffer {} - -/** - * Raw data is stored in instances of the Buffer class. - * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. - * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' - */ -declare var Buffer: { - /** - * Allocates a new buffer containing the given {str}. - * - * @param str String to store in buffer. - * @param encoding encoding to use, optional. Default is 'utf8' - */ - new (str: string, encoding?: string): Buffer; - /** - * Allocates a new buffer of {size} octets. - * - * @param size count of octets to allocate. - */ - new (size: number): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - new (array: Uint8Array): Buffer; - /** - * Produces a Buffer backed by the same allocated memory as - * the given {ArrayBuffer}. - * - * - * @param arrayBuffer The ArrayBuffer with which to share memory. - */ - new (arrayBuffer: ArrayBuffer): Buffer; - /** - * Allocates a new buffer containing the given {array} of octets. - * - * @param array The octets to store. - */ - new (array: any[]): Buffer; - /** - * Copies the passed {buffer} data onto a new {Buffer} instance. - * - * @param buffer The buffer to copy. - */ - new (buffer: Buffer): Buffer; - prototype: Buffer; - /** - * Returns true if {obj} is a Buffer - * - * @param obj object to test. - */ - isBuffer(obj: any): obj is Buffer; - /** - * Returns true if {encoding} is a valid encoding argument. - * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' - * - * @param encoding string to test. - */ - isEncoding(encoding: string): boolean; - /** - * Gives the actual byte length of a string. encoding defaults to 'utf8'. - * This is not the same as String.prototype.length since that returns the number of characters in a string. - * - * @param string string to test. - * @param encoding encoding used to evaluate (defaults to 'utf8') - */ - byteLength(string: string, encoding?: string): number; - /** - * Returns a buffer which is the result of concatenating all the buffers in the list together. - * - * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. - * If the list has exactly one item, then the first item of the list is returned. - * If the list has more than one item, then a new Buffer is created. - * - * @param list An array of Buffer objects to concatenate - * @param totalLength Total length of the buffers when concatenated. - * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. - */ - concat(list: Buffer[], totalLength?: number): Buffer; - /** - * The same as buf1.compare(buf2). - */ - compare(buf1: Buffer, buf2: Buffer): number; -}; - -/************************************************ -* * -* GLOBAL INTERFACES * -* * -************************************************/ -declare namespace NodeJS { - export interface ErrnoException extends Error { - errno?: number; - code?: string; - path?: string; - syscall?: string; - stack?: string; - } - - export interface EventEmitter { - addListener(event: string, listener: Function): this; - on(event: string, listener: Function): this; - once(event: string, listener: Function): this; - removeListener(event: string, listener: Function): this; - removeAllListeners(event?: string): this; - setMaxListeners(n: number): this; - getMaxListeners(): number; - listeners(event: string): Function[]; - emit(event: string, ...args: any[]): boolean; - listenerCount(type: string): number; - } - - export interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string|Buffer; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: T): void; - unshift(chunk: string): void; - unshift(chunk: Buffer): void; - wrap(oldStream: ReadableStream): ReadableStream; - } - - export interface WritableStream extends EventEmitter { - writable: boolean; - write(buffer: Buffer|string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - } - - export interface ReadWriteStream extends ReadableStream, WritableStream {} - - export interface Events extends EventEmitter { } - - export interface Domain extends Events { - run(fn: Function): void; - add(emitter: Events): void; - remove(emitter: Events): void; - bind(cb: (err: Error, data: any) => any): any; - intercept(cb: (data: any) => any): any; - dispose(): void; - - addListener(event: string, listener: Function): this; - on(event: string, listener: Function): this; - once(event: string, listener: Function): this; - removeListener(event: string, listener: Function): this; - removeAllListeners(event?: string): this; - } - - export interface MemoryUsage { - rss: number; - heapTotal: number; - heapUsed: number; - } - - export interface Process extends EventEmitter { - stdout: WritableStream; - stderr: WritableStream; - stdin: ReadableStream; - argv: string[]; - execArgv: string[]; - execPath: string; - abort(): void; - chdir(directory: string): void; - cwd(): string; - env: any; - exit(code?: number): void; - getgid(): number; - setgid(id: number): void; - setgid(id: string): void; - getuid(): number; - setuid(id: number): void; - setuid(id: string): void; - version: string; - versions: { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - openssl: string; - }; - config: { - target_defaults: { - cflags: any[]; - default_configuration: string; - defines: string[]; - include_dirs: string[]; - libraries: string[]; - }; - variables: { - clang: number; - host_arch: string; - node_install_npm: boolean; - node_install_waf: boolean; - node_prefix: string; - node_shared_openssl: boolean; - node_shared_v8: boolean; - node_shared_zlib: boolean; - node_use_dtrace: boolean; - node_use_etw: boolean; - node_use_openssl: boolean; - target_arch: string; - v8_no_strict_aliasing: number; - v8_use_snapshot: boolean; - visibility: string; - }; - }; - kill(pid:number, signal?: string|number): void; - pid: number; - title: string; - arch: string; - platform: string; - memoryUsage(): MemoryUsage; - nextTick(callback: Function): void; - umask(mask?: number): number; - uptime(): number; - hrtime(time?:number[]): number[]; - domain: Domain; - - // Worker - send?(message: any, sendHandle?: any): void; - disconnect(): void; - connected: boolean; - } - - export interface Global { - Array: typeof Array; - ArrayBuffer: typeof ArrayBuffer; - Boolean: typeof Boolean; - Buffer: typeof Buffer; - DataView: typeof DataView; - Date: typeof Date; - Error: typeof Error; - EvalError: typeof EvalError; - Float32Array: typeof Float32Array; - Float64Array: typeof Float64Array; - Function: typeof Function; - GLOBAL: Global; - Infinity: typeof Infinity; - Int16Array: typeof Int16Array; - Int32Array: typeof Int32Array; - Int8Array: typeof Int8Array; - Intl: typeof Intl; - JSON: typeof JSON; - Map: MapConstructor; - Math: typeof Math; - NaN: typeof NaN; - Number: typeof Number; - Object: typeof Object; - Promise: Function; - RangeError: typeof RangeError; - ReferenceError: typeof ReferenceError; - RegExp: typeof RegExp; - Set: SetConstructor; - String: typeof String; - Symbol: Function; - SyntaxError: typeof SyntaxError; - TypeError: typeof TypeError; - URIError: typeof URIError; - Uint16Array: typeof Uint16Array; - Uint32Array: typeof Uint32Array; - Uint8Array: typeof Uint8Array; - Uint8ClampedArray: Function; - WeakMap: WeakMapConstructor; - WeakSet: WeakSetConstructor; - clearImmediate: (immediateId: any) => void; - clearInterval: (intervalId: NodeJS.Timer) => void; - clearTimeout: (timeoutId: NodeJS.Timer) => void; - console: typeof console; - decodeURI: typeof decodeURI; - decodeURIComponent: typeof decodeURIComponent; - encodeURI: typeof encodeURI; - encodeURIComponent: typeof encodeURIComponent; - escape: (str: string) => string; - eval: typeof eval; - global: Global; - isFinite: typeof isFinite; - isNaN: typeof isNaN; - parseFloat: typeof parseFloat; - parseInt: typeof parseInt; - process: Process; - root: Global; - setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any; - setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; - setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; - undefined: typeof undefined; - unescape: (str: string) => string; - gc: () => void; - v8debug?: any; - } - - export interface Timer { - ref() : void; - unref() : void; - } -} - -/** - * @deprecated - */ -interface NodeBuffer extends Uint8Array { - write(string: string, offset?: number, length?: number, encoding?: string): number; - toString(encoding?: string, start?: number, end?: number): string; - toJSON(): any; - equals(otherBuffer: Buffer): boolean; - compare(otherBuffer: Buffer): number; - copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; - slice(start?: number, end?: number): Buffer; - writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; - readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; - readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; - readUInt8(offset: number, noAssert?: boolean): number; - readUInt16LE(offset: number, noAssert?: boolean): number; - readUInt16BE(offset: number, noAssert?: boolean): number; - readUInt32LE(offset: number, noAssert?: boolean): number; - readUInt32BE(offset: number, noAssert?: boolean): number; - readInt8(offset: number, noAssert?: boolean): number; - readInt16LE(offset: number, noAssert?: boolean): number; - readInt16BE(offset: number, noAssert?: boolean): number; - readInt32LE(offset: number, noAssert?: boolean): number; - readInt32BE(offset: number, noAssert?: boolean): number; - readFloatLE(offset: number, noAssert?: boolean): number; - readFloatBE(offset: number, noAssert?: boolean): number; - readDoubleLE(offset: number, noAssert?: boolean): number; - readDoubleBE(offset: number, noAssert?: boolean): number; - writeUInt8(value: number, offset: number, noAssert?: boolean): number; - writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeInt8(value: number, offset: number, noAssert?: boolean): number; - writeInt16LE(value: number, offset: number, noAssert?: boolean): number; - writeInt16BE(value: number, offset: number, noAssert?: boolean): number; - writeInt32LE(value: number, offset: number, noAssert?: boolean): number; - writeInt32BE(value: number, offset: number, noAssert?: boolean): number; - writeFloatLE(value: number, offset: number, noAssert?: boolean): number; - writeFloatBE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; - writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; - fill(value: any, offset?: number, end?: number): Buffer; - // TODO: encoding param - indexOf(value: string | number | Buffer, byteOffset?: number): number; - // TODO: entries - // TODO: includes - // TODO: keys - // TODO: values -} - -/************************************************ -* * -* MODULES * -* * -************************************************/ -declare module "buffer" { - export var INSPECT_MAX_BYTES: number; - var BuffType: typeof Buffer; - var SlowBuffType: typeof SlowBuffer; - export { BuffType as Buffer, SlowBuffType as SlowBuffer }; -} - -declare module "querystring" { - export interface StringifyOptions { - encodeURIComponent?: Function; - } - - export interface ParseOptions { - maxKeys?: number; - decodeURIComponent?: Function; - } - - export function stringify(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string; - export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): any; - export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): T; - export function escape(str: string): string; - export function unescape(str: string): string; -} - -declare module "events" { - export class EventEmitter implements NodeJS.EventEmitter { - static EventEmitter: EventEmitter; - static listenerCount(emitter: EventEmitter, event: string): number; // deprecated - static defaultMaxListeners: number; - - addListener(event: string, listener: Function): this; - on(event: string, listener: Function): this; - once(event: string, listener: Function): this; - removeListener(event: string, listener: Function): this; - removeAllListeners(event?: string): this; - setMaxListeners(n: number): this; - getMaxListeners(): number; - listeners(event: string): Function[]; - emit(event: string, ...args: any[]): boolean; - listenerCount(type: string): number; - } -} - -declare module "http" { - import * as events from "events"; - import * as net from "net"; - import * as stream from "stream"; - - export interface RequestOptions { - protocol?: string; - host?: string; - hostname?: string; - family?: number; - port?: number; - localAddress?: string; - socketPath?: string; - method?: string; - path?: string; - headers?: { [key: string]: any }; - auth?: string; - agent?: Agent|boolean; - } - - export interface Server extends events.EventEmitter, net.Server { - setTimeout(msecs: number, callback: Function): void; - maxHeadersCount: number; - timeout: number; - } - /** - * @deprecated Use IncomingMessage - */ - export interface ServerRequest extends IncomingMessage { - connection: net.Socket; - } - export interface ServerResponse extends events.EventEmitter, stream.Writable { - // Extended base methods - write(buffer: Buffer): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - write(str: string, encoding?: string, fd?: string): boolean; - - writeContinue(): void; - writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void; - writeHead(statusCode: number, headers?: any): void; - statusCode: number; - statusMessage: string; - headersSent: boolean; - setHeader(name: string, value: string | string[]): void; - sendDate: boolean; - getHeader(name: string): string; - removeHeader(name: string): void; - write(chunk: any, encoding?: string): any; - addTrailers(headers: any): void; - - // Extended base methods - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - end(data?: any, encoding?: string): void; - } - export interface ClientRequest extends events.EventEmitter, stream.Writable { - // Extended base methods - write(buffer: Buffer): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - write(str: string, encoding?: string, fd?: string): boolean; - - write(chunk: any, encoding?: string): void; - abort(): void; - setTimeout(timeout: number, callback?: Function): void; - setNoDelay(noDelay?: boolean): void; - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - - setHeader(name: string, value: string | string[]): void; - getHeader(name: string): string; - removeHeader(name: string): void; - addTrailers(headers: any): void; - - // Extended base methods - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - end(data?: any, encoding?: string): void; - } - export interface IncomingMessage extends events.EventEmitter, stream.Readable { - httpVersion: string; - headers: any; - rawHeaders: string[]; - trailers: any; - rawTrailers: any; - setTimeout(msecs: number, callback: Function): NodeJS.Timer; - /** - * Only valid for request obtained from http.Server. - */ - method?: string; - /** - * Only valid for request obtained from http.Server. - */ - url?: string; - /** - * Only valid for response obtained from http.ClientRequest. - */ - statusCode?: number; - /** - * Only valid for response obtained from http.ClientRequest. - */ - statusMessage?: string; - socket: net.Socket; - } - /** - * @deprecated Use IncomingMessage - */ - export interface ClientResponse extends IncomingMessage { } - - export interface AgentOptions { - /** - * Keep sockets around in a pool to be used by other requests in the future. Default = false - */ - keepAlive?: boolean; - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - */ - keepAliveMsecs?: number; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number; - } - - export class Agent { - maxSockets: number; - sockets: any; - requests: any; - - constructor(opts?: AgentOptions); - - /** - * Destroy any sockets that are currently in use by the agent. - * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled, - * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise, - * sockets may hang open for quite a long time before the server terminates them. - */ - destroy(): void; - } - - export var METHODS: string[]; - - export var STATUS_CODES: { - [errorCode: number]: string; - [errorCode: string]: string; - }; - export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) =>void ): Server; - export function createClient(port?: number, host?: string): any; - export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest; - export var globalAgent: Agent; -} - -declare module "cluster" { - import * as child from "child_process"; - import * as events from "events"; - - export interface ClusterSettings { - exec?: string; - args?: string[]; - silent?: boolean; - } - - export interface Address { - address: string; - port: number; - addressType: string; - } - - export class Worker extends events.EventEmitter { - id: string; - process: child.ChildProcess; - suicide: boolean; - send(message: any, sendHandle?: any): void; - kill(signal?: string): void; - destroy(signal?: string): void; - disconnect(): void; - isConnected(): boolean; - isDead(): boolean; - } - - export var settings: ClusterSettings; - export var isMaster: boolean; - export var isWorker: boolean; - export function setupMaster(settings?: ClusterSettings): void; - export function fork(env?: any): Worker; - export function disconnect(callback?: Function): void; - export var worker: Worker; - export var workers: { - [index: string]: Worker - }; - - // Event emitter - export function addListener(event: string, listener: Function): void; - export function on(event: "disconnect", listener: (worker: Worker) => void): void; - export function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): void; - export function on(event: "fork", listener: (worker: Worker) => void): void; - export function on(event: "listening", listener: (worker: Worker, address: any) => void): void; - export function on(event: "message", listener: (worker: Worker, message: any) => void): void; - export function on(event: "online", listener: (worker: Worker) => void): void; - export function on(event: "setup", listener: (settings: any) => void): void; - export function on(event: string, listener: Function): any; - export function once(event: string, listener: Function): void; - export function removeListener(event: string, listener: Function): void; - export function removeAllListeners(event?: string): void; - export function setMaxListeners(n: number): void; - export function listeners(event: string): Function[]; - export function emit(event: string, ...args: any[]): boolean; -} - -declare module "zlib" { - import * as stream from "stream"; - export interface ZlibOptions { chunkSize?: number; windowBits?: number; level?: number; memLevel?: number; strategy?: number; dictionary?: any; } - - export interface Gzip extends stream.Transform { } - export interface Gunzip extends stream.Transform { } - export interface Deflate extends stream.Transform { } - export interface Inflate extends stream.Transform { } - export interface DeflateRaw extends stream.Transform { } - export interface InflateRaw extends stream.Transform { } - export interface Unzip extends stream.Transform { } - - export function createGzip(options?: ZlibOptions): Gzip; - export function createGunzip(options?: ZlibOptions): Gunzip; - export function createDeflate(options?: ZlibOptions): Deflate; - export function createInflate(options?: ZlibOptions): Inflate; - export function createDeflateRaw(options?: ZlibOptions): DeflateRaw; - export function createInflateRaw(options?: ZlibOptions): InflateRaw; - export function createUnzip(options?: ZlibOptions): Unzip; - - export function deflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function deflateSync(buf: Buffer, options?: ZlibOptions): any; - export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function deflateRawSync(buf: Buffer, options?: ZlibOptions): any; - export function gzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function gzipSync(buf: Buffer, options?: ZlibOptions): any; - export function gunzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function gunzipSync(buf: Buffer, options?: ZlibOptions): any; - export function inflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function inflateSync(buf: Buffer, options?: ZlibOptions): any; - export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function inflateRawSync(buf: Buffer, options?: ZlibOptions): any; - export function unzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; - export function unzipSync(buf: Buffer, options?: ZlibOptions): any; - - // Constants - export var Z_NO_FLUSH: number; - export var Z_PARTIAL_FLUSH: number; - export var Z_SYNC_FLUSH: number; - export var Z_FULL_FLUSH: number; - export var Z_FINISH: number; - export var Z_BLOCK: number; - export var Z_TREES: number; - export var Z_OK: number; - export var Z_STREAM_END: number; - export var Z_NEED_DICT: number; - export var Z_ERRNO: number; - export var Z_STREAM_ERROR: number; - export var Z_DATA_ERROR: number; - export var Z_MEM_ERROR: number; - export var Z_BUF_ERROR: number; - export var Z_VERSION_ERROR: number; - export var Z_NO_COMPRESSION: number; - export var Z_BEST_SPEED: number; - export var Z_BEST_COMPRESSION: number; - export var Z_DEFAULT_COMPRESSION: number; - export var Z_FILTERED: number; - export var Z_HUFFMAN_ONLY: number; - export var Z_RLE: number; - export var Z_FIXED: number; - export var Z_DEFAULT_STRATEGY: number; - export var Z_BINARY: number; - export var Z_TEXT: number; - export var Z_ASCII: number; - export var Z_UNKNOWN: number; - export var Z_DEFLATED: number; - export var Z_NULL: number; -} - -declare module "os" { - export interface CpuInfo { - model: string; - speed: number; - times: { - user: number; - nice: number; - sys: number; - idle: number; - irq: number; - }; - } - - export interface NetworkInterfaceInfo { - address: string; - netmask: string; - family: string; - mac: string; - internal: boolean; - } - - export function tmpdir(): string; - export function homedir(): string; - export function endianness(): string; - export function hostname(): string; - export function type(): string; - export function platform(): string; - export function arch(): string; - export function release(): string; - export function uptime(): number; - export function loadavg(): number[]; - export function totalmem(): number; - export function freemem(): number; - export function cpus(): CpuInfo[]; - export function networkInterfaces(): {[index: string]: NetworkInterfaceInfo[]}; - export var EOL: string; -} - -declare module "https" { - import * as tls from "tls"; - import * as events from "events"; - import * as http from "http"; - - export interface ServerOptions { - pfx?: any; - key?: any; - passphrase?: string; - cert?: any; - ca?: any; - crl?: any; - ciphers?: string; - honorCipherOrder?: boolean; - requestCert?: boolean; - rejectUnauthorized?: boolean; - NPNProtocols?: any; - SNICallback?: (servername: string) => any; - } - - export interface RequestOptions extends http.RequestOptions{ - pfx?: any; - key?: any; - passphrase?: string; - cert?: any; - ca?: any; - ciphers?: string; - rejectUnauthorized?: boolean; - secureProtocol?: string; - } - - export interface Agent { - maxSockets: number; - sockets: any; - requests: any; - } - export var Agent: { - new (options?: RequestOptions): Agent; - }; - export interface Server extends tls.Server { } - export function createServer(options: ServerOptions, requestListener?: Function): Server; - export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; - export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) =>void ): http.ClientRequest; - export var globalAgent: Agent; -} - -declare module "punycode" { - export function decode(string: string): string; - export function encode(string: string): string; - export function toUnicode(domain: string): string; - export function toASCII(domain: string): string; - export var ucs2: ucs2; - interface ucs2 { - decode(string: string): number[]; - encode(codePoints: number[]): string; - } - export var version: any; -} - -declare module "repl" { - import * as stream from "stream"; - import * as events from "events"; - - export interface ReplOptions { - prompt?: string; - input?: NodeJS.ReadableStream; - output?: NodeJS.WritableStream; - terminal?: boolean; - eval?: Function; - useColors?: boolean; - useGlobal?: boolean; - ignoreUndefined?: boolean; - writer?: Function; - } - export function start(options: ReplOptions): events.EventEmitter; -} - -declare module "readline" { - import * as events from "events"; - import * as stream from "stream"; - - export interface Key { - sequence?: string; - name?: string; - ctrl?: boolean; - meta?: boolean; - shift?: boolean; - } - - export interface ReadLine extends events.EventEmitter { - setPrompt(prompt: string): void; - prompt(preserveCursor?: boolean): void; - question(query: string, callback: (answer: string) => void): void; - pause(): ReadLine; - resume(): ReadLine; - close(): void; - write(data: string|Buffer, key?: Key): void; - } - - export interface Completer { - (line: string): CompleterResult; - (line: string, callback: (err: any, result: CompleterResult) => void): any; - } - - export interface CompleterResult { - completions: string[]; - line: string; - } - - export interface ReadLineOptions { - input: NodeJS.ReadableStream; - output?: NodeJS.WritableStream; - completer?: Completer; - terminal?: boolean; - historySize?: number; - } - - export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer, terminal?: boolean): ReadLine; - export function createInterface(options: ReadLineOptions): ReadLine; - - export function cursorTo(stream: NodeJS.WritableStream, x: number, y: number): void; - export function moveCursor(stream: NodeJS.WritableStream, dx: number|string, dy: number|string): void; - export function clearLine(stream: NodeJS.WritableStream, dir: number): void; - export function clearScreenDown(stream: NodeJS.WritableStream): void; -} - -declare module "vm" { - export interface Context { } - export interface ScriptOptions { - filename?: string; - lineOffset?: number; - columnOffset?: number; - displayErrors?: boolean; - timeout?: number; - cachedData?: Buffer; - produceCachedData?: boolean; - } - export interface RunningScriptOptions { - filename?: string; - lineOffset?: number; - columnOffset?: number; - displayErrors?: boolean; - timeout?: number; - } - export class Script { - constructor(code: string, options?: ScriptOptions); - runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any; - runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any; - runInThisContext(options?: RunningScriptOptions): any; - } - export function createContext(sandbox?: Context): Context; - export function isContext(sandbox: Context): boolean; - export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions): any; - export function runInDebugContext(code: string): any; - export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions): any; - export function runInThisContext(code: string, options?: RunningScriptOptions): any; -} - -declare module "child_process" { - import * as events from "events"; - import * as stream from "stream"; - - export interface ChildProcess extends events.EventEmitter { - stdin: stream.Writable; - stdout: stream.Readable; - stderr: stream.Readable; - stdio: [stream.Writable, stream.Readable, stream.Readable]; - pid: number; - kill(signal?: string): void; - send(message: any, sendHandle?: any): void; - disconnect(): void; - unref(): void; - } - - export interface SpawnOptions { - cwd?: string; - env?: any; - stdio?: any; - detached?: boolean; - uid?: number; - gid?: number; - shell?: boolean | string; - } - export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess; - - export interface ExecOptions { - cwd?: string; - env?: any; - shell?: string; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - uid?: number; - gid?: number; - } - export interface ExecOptionsWithStringEncoding extends ExecOptions { - encoding: BufferEncoding; - } - export interface ExecOptionsWithBufferEncoding extends ExecOptions { - encoding: string; // specify `null`. - } - export function exec(command: string, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; - export function exec(command: string, options: ExecOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; - // usage. child_process.exec("tsc", {encoding: null as string}, (err, stdout, stderr) => {}); - export function exec(command: string, options: ExecOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function exec(command: string, options: ExecOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; - - export interface ExecFileOptions { - cwd?: string; - env?: any; - timeout?: number; - maxBuffer?: number; - killSignal?: string; - uid?: number; - gid?: number; - } - export interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - export interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { - encoding: string; // specify `null`. - } - export function execFile(file: string, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; - export function execFile(file: string, options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; - // usage. child_process.execFile("file.sh", {encoding: null as string}, (err, stdout, stderr) => {}); - export function execFile(file: string, options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function execFile(file: string, options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; - export function execFile(file: string, args?: string[], callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; - export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; - // usage. child_process.execFile("file.sh", ["foo"], {encoding: null as string}, (err, stdout, stderr) => {}); - export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function execFile(file: string, args?: string[], options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) =>void ): ChildProcess; - - export interface ForkOptions { - cwd?: string; - env?: any; - execPath?: string; - execArgv?: string[]; - silent?: boolean; - uid?: number; - gid?: number; - } - export function fork(modulePath: string, args?: string[], options?: ForkOptions): ChildProcess; - - export interface SpawnSyncOptions { - cwd?: string; - input?: string | Buffer; - stdio?: any; - env?: any; - uid?: number; - gid?: number; - timeout?: number; - killSignal?: string; - maxBuffer?: number; - encoding?: string; - shell?: boolean | string; - } - export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { - encoding: BufferEncoding; - } - export interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { - encoding: string; // specify `null`. - } - export interface SpawnSyncReturns { - pid: number; - output: string[]; - stdout: T; - stderr: T; - status: number; - signal: string; - error: Error; - } - export function spawnSync(command: string): SpawnSyncReturns; - export function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - export function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - export function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; - export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; - export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; - export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptions): SpawnSyncReturns; - - export interface ExecSyncOptions { - cwd?: string; - input?: string | Buffer; - stdio?: any; - env?: any; - shell?: string; - uid?: number; - gid?: number; - timeout?: number; - killSignal?: string; - maxBuffer?: number; - encoding?: string; - } - export interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { - encoding: BufferEncoding; - } - export interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { - encoding: string; // specify `null`. - } - export function execSync(command: string): Buffer; - export function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string; - export function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer; - export function execSync(command: string, options?: ExecSyncOptions): Buffer; - - export interface ExecFileSyncOptions { - cwd?: string; - input?: string | Buffer; - stdio?: any; - env?: any; - uid?: number; - gid?: number; - timeout?: number; - killSignal?: string; - maxBuffer?: number; - encoding?: string; - } - export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; - } - export interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { - encoding: string; // specify `null`. - } - export function execFileSync(command: string): Buffer; - export function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string; - export function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; - export function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer; - export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithStringEncoding): string; - export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; - export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptions): Buffer; -} - -declare module "url" { - export interface Url { - href?: string; - protocol?: string; - auth?: string; - hostname?: string; - port?: string; - host?: string; - pathname?: string; - search?: string; - query?: any; // string | Object - slashes?: boolean; - hash?: string; - path?: string; - } - - export function parse(urlStr: string, parseQueryString?: boolean , slashesDenoteHost?: boolean ): Url; - export function format(url: Url): string; - export function resolve(from: string, to: string): string; -} - -declare module "dns" { - export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) =>void ): string; - export function lookup(domain: string, callback: (err: Error, address: string, family: number) =>void ): string; - export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve4(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolve6(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveMx(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) =>void ): string[]; - export function reverse(ip: string, callback: (err: Error, domains: string[]) =>void ): string[]; -} - -declare module "net" { - import * as stream from "stream"; - - export interface Socket extends stream.Duplex { - // Extended base methods - write(buffer: Buffer): boolean; - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; - write(str: string, encoding?: string, fd?: string): boolean; - - connect(port: number, host?: string, connectionListener?: Function): void; - connect(path: string, connectionListener?: Function): void; - bufferSize: number; - setEncoding(encoding?: string): void; - write(data: any, encoding?: string, callback?: Function): void; - destroy(): void; - pause(): void; - resume(): void; - setTimeout(timeout: number, callback?: Function): void; - setNoDelay(noDelay?: boolean): void; - setKeepAlive(enable?: boolean, initialDelay?: number): void; - address(): { port: number; family: string; address: string; }; - unref(): void; - ref(): void; - - remoteAddress: string; - remoteFamily: string; - remotePort: number; - localAddress: string; - localPort: number; - bytesRead: number; - bytesWritten: number; - - // Extended base methods - end(): void; - end(buffer: Buffer, cb?: Function): void; - end(str: string, cb?: Function): void; - end(str: string, encoding?: string, cb?: Function): void; - end(data?: any, encoding?: string): void; - } - - export var Socket: { - new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket; - }; - - export interface ListenOptions { - port?: number; - host?: string; - backlog?: number; - path?: string; - exclusive?: boolean; - } - - export interface Server extends Socket { - listen(port: number, hostname?: string, backlog?: number, listeningListener?: Function): Server; - listen(port: number, hostname?: string, listeningListener?: Function): Server; - listen(port: number, backlog?: number, listeningListener?: Function): Server; - listen(port: number, listeningListener?: Function): Server; - listen(path: string, backlog?: number, listeningListener?: Function): Server; - listen(path: string, listeningListener?: Function): Server; - listen(handle: any, backlog?: number, listeningListener?: Function): Server; - listen(handle: any, listeningListener?: Function): Server; - listen(options: ListenOptions, listeningListener?: Function): Server; - close(callback?: Function): Server; - address(): { port: number; family: string; address: string; }; - getConnections(cb: (error: Error, count: number) => void): void; - ref(): Server; - unref(): Server; - maxConnections: number; - connections: number; - } - export function createServer(connectionListener?: (socket: Socket) =>void ): Server; - export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) =>void ): Server; - export function connect(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; - export function connect(port: number, host?: string, connectionListener?: Function): Socket; - export function connect(path: string, connectionListener?: Function): Socket; - export function createConnection(options: { port: number, host?: string, localAddress? : string, localPort? : string, family? : number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket; - export function createConnection(port: number, host?: string, connectionListener?: Function): Socket; - export function createConnection(path: string, connectionListener?: Function): Socket; - export function isIP(input: string): number; - export function isIPv4(input: string): boolean; - export function isIPv6(input: string): boolean; -} - -declare module "dgram" { - import * as events from "events"; - - interface RemoteInfo { - address: string; - port: number; - size: number; - } - - interface AddressInfo { - address: string; - family: string; - port: number; - } - - export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - - interface Socket extends events.EventEmitter { - send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; - bind(port: number, address?: string, callback?: () => void): void; - close(): void; - address(): AddressInfo; - setBroadcast(flag: boolean): void; - setMulticastTTL(ttl: number): void; - setMulticastLoopback(flag: boolean): void; - addMembership(multicastAddress: string, multicastInterface?: string): void; - dropMembership(multicastAddress: string, multicastInterface?: string): void; - } -} - -declare module "fs" { - import * as stream from "stream"; - import * as events from "events"; - - interface Stats { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: number; - ino: number; - mode: number; - nlink: number; - uid: number; - gid: number; - rdev: number; - size: number; - blksize: number; - blocks: number; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; - } - - interface FSWatcher extends events.EventEmitter { - close(): void; - } - - export interface ReadStream extends stream.Readable { - close(): void; - } - export interface WriteStream extends stream.Writable { - close(): void; - bytesWritten: number; - } - - /** - * Asynchronous rename. - * @param oldPath - * @param newPath - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - /** - * Synchronous rename - * @param oldPath - * @param newPath - */ - export function renameSync(oldPath: string, newPath: string): void; - export function truncate(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function truncate(path: string, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function truncateSync(path: string, len?: number): void; - export function ftruncate(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function ftruncate(fd: number, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function ftruncateSync(fd: number, len?: number): void; - export function chown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chownSync(path: string, uid: number, gid: number): void; - export function fchown(fd: number, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fchownSync(fd: number, uid: number, gid: number): void; - export function lchown(path: string, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchownSync(path: string, uid: number, gid: number): void; - export function chmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function chmodSync(path: string, mode: number): void; - export function chmodSync(path: string, mode: string): void; - export function fchmod(fd: number, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fchmod(fd: number, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fchmodSync(fd: number, mode: number): void; - export function fchmodSync(fd: number, mode: string): void; - export function lchmod(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchmod(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function lchmodSync(path: string, mode: number): void; - export function lchmodSync(path: string, mode: string): void; - export function stat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; - export function lstat(path: string, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; - export function fstat(fd: number, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void; - export function statSync(path: string): Stats; - export function lstatSync(path: string): Stats; - export function fstatSync(fd: number): Stats; - export function link(srcpath: string, dstpath: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function linkSync(srcpath: string, dstpath: string): void; - export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function symlinkSync(srcpath: string, dstpath: string, type?: string): void; - export function readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; - export function readlinkSync(path: string): string; - export function realpath(path: string, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void; - export function realpath(path: string, cache: {[path: string]: string}, callback: (err: NodeJS.ErrnoException, resolvedPath: string) =>any): void; - export function realpathSync(path: string, cache?: { [path: string]: string }): string; - /* - * Asynchronous unlink - deletes the file specified in {path} - * - * @param path - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function unlink(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - /* - * Synchronous unlink - deletes the file specified in {path} - * - * @param path - */ - export function unlinkSync(path: string): void; - /* - * Asynchronous rmdir - removes the directory specified in {path} - * - * @param path - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function rmdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - /* - * Synchronous rmdir - removes the directory specified in {path} - * - * @param path - */ - export function rmdirSync(path: string): void; - /* - * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. - * - * @param path - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function mkdir(path: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - /* - * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. - * - * @param path - * @param mode - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function mkdir(path: string, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - /* - * Asynchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. - * - * @param path - * @param mode - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function mkdir(path: string, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void; - /* - * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. - * - * @param path - * @param mode - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function mkdirSync(path: string, mode?: number): void; - /* - * Synchronous mkdir - creates the directory specified in {path}. Parameter {mode} defaults to 0777. - * - * @param path - * @param mode - * @param callback No arguments other than a possible exception are given to the completion callback. - */ - export function mkdirSync(path: string, mode?: string): void; - export function readdir(path: string, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void; - export function readdirSync(path: string): string[]; - export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function closeSync(fd: number): void; - export function open(path: string, flags: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function open(path: string, flags: string, mode: number, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function open(path: string, flags: string, mode: string, callback?: (err: NodeJS.ErrnoException, fd: number) => any): void; - export function openSync(path: string, flags: string, mode?: number): number; - export function openSync(path: string, flags: string, mode?: string): number; - export function utimes(path: string, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function utimes(path: string, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function utimesSync(path: string, atime: number, mtime: number): void; - export function utimesSync(path: string, atime: Date, mtime: Date): void; - export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function futimesSync(fd: number, atime: number, mtime: number): void; - export function futimesSync(fd: number, atime: Date, mtime: Date): void; - export function fsync(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void; - export function fsyncSync(fd: number): void; - export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; - export function write(fd: number, buffer: Buffer, offset: number, length: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void; - export function write(fd: number, data: any, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; - export function write(fd: number, data: any, offset: number, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; - export function write(fd: number, data: any, offset: number, encoding: string, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; - export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position?: number): number; - export function writeSync(fd: number, data: any, position?: number, enconding?: string): number; - export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void; - export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number; - /* - * Asynchronous readFile - Asynchronously reads the entire contents of a file. - * - * @param fileName - * @param encoding - * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. - */ - export function readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; - /* - * Asynchronous readFile - Asynchronously reads the entire contents of a file. - * - * @param fileName - * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer. - * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. - */ - export function readFile(filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void): void; - /* - * Asynchronous readFile - Asynchronously reads the entire contents of a file. - * - * @param fileName - * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer. - * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. - */ - export function readFile(filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; - /* - * Asynchronous readFile - Asynchronously reads the entire contents of a file. - * - * @param fileName - * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file. - */ - export function readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; - /* - * Synchronous readFile - Synchronously reads the entire contents of a file. - * - * @param fileName - * @param encoding - */ - export function readFileSync(filename: string, encoding: string): string; - /* - * Synchronous readFile - Synchronously reads the entire contents of a file. - * - * @param fileName - * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer. - */ - export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string; - /* - * Synchronous readFile - Synchronously reads the entire contents of a file. - * - * @param fileName - * @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer. - */ - export function readFileSync(filename: string, options?: { flag?: string; }): Buffer; - export function writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; - export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; - export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; - export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; - export function appendFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; - export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; - export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void; - export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void; - export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void; - export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void; - export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher; - export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher; - export function exists(path: string, callback?: (exists: boolean) => void): void; - export function existsSync(path: string): boolean; - /** Constant for fs.access(). File is visible to the calling process. */ - export var F_OK: number; - /** Constant for fs.access(). File can be read by the calling process. */ - export var R_OK: number; - /** Constant for fs.access(). File can be written by the calling process. */ - export var W_OK: number; - /** Constant for fs.access(). File can be executed by the calling process. */ - export var X_OK: number; - /** Tests a user's permissions for the file specified by path. */ - export function access(path: string, callback: (err: NodeJS.ErrnoException) => void): void; - export function access(path: string, mode: number, callback: (err: NodeJS.ErrnoException) => void): void; - /** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */ - export function accessSync(path: string, mode ?: number): void; - export function createReadStream(path: string, options?: { - flags?: string; - encoding?: string; - fd?: number; - mode?: number; - autoClose?: boolean; - }): ReadStream; - export function createWriteStream(path: string, options?: { - flags?: string; - encoding?: string; - fd?: number; - mode?: number; - }): WriteStream; -} - -declare module "path" { - - /** - * A parsed path object generated by path.parse() or consumed by path.format(). - */ - export interface ParsedPath { - /** - * The root of the path such as '/' or 'c:\' - */ - root: string; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir: string; - /** - * The file name including extension (if any) such as 'index.html' - */ - base: string; - /** - * The file extension (if any) such as '.html' - */ - ext: string; - /** - * The file name without extension (if any) such as 'index' - */ - name: string; - } - - /** - * Normalize a string path, reducing '..' and '.' parts. - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. - * - * @param p string path to normalize. - */ - export function normalize(p: string): string; - /** - * Join all arguments together and normalize the resulting path. - * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. - * - * @param paths string paths to join. - */ - export function join(...paths: any[]): string; - /** - * Join all arguments together and normalize the resulting path. - * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. - * - * @param paths string paths to join. - */ - export function join(...paths: string[]): string; - /** - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. - * - * Starting from leftmost {from} paramter, resolves {to} to an absolute path. - * - * If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory. - * - * @param pathSegments string paths to join. Non-string arguments are ignored. - */ - export function resolve(...pathSegments: any[]): string; - /** - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. - * - * @param path path to test. - */ - export function isAbsolute(path: string): boolean; - /** - * Solve the relative path from {from} to {to}. - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. - * - * @param from - * @param to - */ - export function relative(from: string, to: string): string; - /** - * Return the directory name of a path. Similar to the Unix dirname command. - * - * @param p the path to evaluate. - */ - export function dirname(p: string): string; - /** - * Return the last portion of a path. Similar to the Unix basename command. - * Often used to extract the file name from a fully qualified path. - * - * @param p the path to evaluate. - * @param ext optionally, an extension to remove from the result. - */ - export function basename(p: string, ext?: string): string; - /** - * Return the extension of the path, from the last '.' to end of string in the last portion of the path. - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string - * - * @param p the path to evaluate. - */ - export function extname(p: string): string; - /** - * The platform-specific file separator. '\\' or '/'. - */ - export var sep: string; - /** - * The platform-specific file delimiter. ';' or ':'. - */ - export var delimiter: string; - /** - * Returns an object from a path string - the opposite of format(). - * - * @param pathString path to evaluate. - */ - export function parse(pathString: string): ParsedPath; - /** - * Returns a path string from an object - the opposite of parse(). - * - * @param pathString path to evaluate. - */ - export function format(pathObject: ParsedPath): string; - - export module posix { - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(...pathSegments: any[]): string; - export function isAbsolute(p: string): boolean; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; - export var delimiter: string; - export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; - } - - export module win32 { - export function normalize(p: string): string; - export function join(...paths: any[]): string; - export function resolve(...pathSegments: any[]): string; - export function isAbsolute(p: string): boolean; - export function relative(from: string, to: string): string; - export function dirname(p: string): string; - export function basename(p: string, ext?: string): string; - export function extname(p: string): string; - export var sep: string; - export var delimiter: string; - export function parse(p: string): ParsedPath; - export function format(pP: ParsedPath): string; - } -} - -declare module "string_decoder" { - export interface NodeStringDecoder { - write(buffer: Buffer): string; - detectIncompleteChar(buffer: Buffer): number; - } - export var StringDecoder: { - new (encoding: string): NodeStringDecoder; - }; -} - -declare module "tls" { - import * as crypto from "crypto"; - import * as net from "net"; - import * as stream from "stream"; - - var CLIENT_RENEG_LIMIT: number; - var CLIENT_RENEG_WINDOW: number; - - export interface TlsOptions { - host?: string; - port?: number; - pfx?: any; //string or buffer - key?: any; //string or buffer - passphrase?: string; - cert?: any; - ca?: any; //string or buffer - crl?: any; //string or string array - ciphers?: string; - honorCipherOrder?: any; - requestCert?: boolean; - rejectUnauthorized?: boolean; - NPNProtocols?: any; //array or Buffer; - SNICallback?: (servername: string) => any; - } - - export interface ConnectionOptions { - host?: string; - port?: number; - socket?: net.Socket; - pfx?: any; //string | Buffer - key?: any; //string | Buffer - passphrase?: string; - cert?: any; //string | Buffer - ca?: any; //Array of string | Buffer - rejectUnauthorized?: boolean; - NPNProtocols?: any; //Array of string | Buffer - servername?: string; - } - - export interface Server extends net.Server { - close(): Server; - address(): { port: number; family: string; address: string; }; - addContext(hostName: string, credentials: { - key: string; - cert: string; - ca: string; - }): void; - maxConnections: number; - connections: number; - } - - export interface ClearTextStream extends stream.Duplex { - authorized: boolean; - authorizationError: Error; - getPeerCertificate(): any; - getCipher: { - name: string; - version: string; - }; - address: { - port: number; - family: string; - address: string; - }; - remoteAddress: string; - remotePort: number; - } - - export interface SecurePair { - encrypted: any; - cleartext: any; - } - - export interface SecureContextOptions { - pfx?: any; //string | buffer - key?: any; //string | buffer - passphrase?: string; - cert?: any; // string | buffer - ca?: any; // string | buffer - crl?: any; // string | string[] - ciphers?: string; - honorCipherOrder?: boolean; - } - - export interface SecureContext { - context: any; - } - - export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) =>void ): Server; - export function connect(options: TlsOptions, secureConnectionListener?: () =>void ): ClearTextStream; - export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; - export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () =>void ): ClearTextStream; - export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; - export function createSecureContext(details: SecureContextOptions): SecureContext; -} - -declare module "crypto" { - export interface CredentialDetails { - pfx: string; - key: string; - passphrase: string; - cert: string; - ca: any; //string | string array - crl: any; //string | string array - ciphers: string; - } - export interface Credentials { context?: any; } - export function createCredentials(details: CredentialDetails): Credentials; - export function createHash(algorithm: string): Hash; - export function createHmac(algorithm: string, key: string): Hmac; - export function createHmac(algorithm: string, key: Buffer): Hmac; - export interface Hash { - update(data: any, input_encoding?: string): Hash; - digest(encoding: 'buffer'): Buffer; - digest(encoding: string): any; - digest(): Buffer; - } - export interface Hmac extends NodeJS.ReadWriteStream { - update(data: any, input_encoding?: string): Hmac; - digest(encoding: 'buffer'): Buffer; - digest(encoding: string): any; - digest(): Buffer; - } - export function createCipher(algorithm: string, password: any): Cipher; - export function createCipheriv(algorithm: string, key: any, iv: any): Cipher; - export interface Cipher extends NodeJS.ReadWriteStream { - update(data: Buffer): Buffer; - update(data: string, input_encoding: "utf8"|"ascii"|"binary"): Buffer; - update(data: Buffer, input_encoding: any, output_encoding: "binary"|"base64"|"hex"): string; - update(data: string, input_encoding: "utf8"|"ascii"|"binary", output_encoding: "binary"|"base64"|"hex"): string; - final(): Buffer; - final(output_encoding: string): string; - setAutoPadding(auto_padding: boolean): void; - getAuthTag(): Buffer; - } - export function createDecipher(algorithm: string, password: any): Decipher; - export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; - export interface Decipher extends NodeJS.ReadWriteStream { - update(data: Buffer): Buffer; - update(data: string, input_encoding: "binary"|"base64"|"hex"): Buffer; - update(data: Buffer, input_encoding: any, output_encoding: "utf8"|"ascii"|"binary"): string; - update(data: string, input_encoding: "binary"|"base64"|"hex", output_encoding: "utf8"|"ascii"|"binary"): string; - final(): Buffer; - final(output_encoding: string): string; - setAutoPadding(auto_padding: boolean): void; - setAuthTag(tag: Buffer): void; - } - export function createSign(algorithm: string): Signer; - export interface Signer extends NodeJS.WritableStream { - update(data: any): void; - sign(private_key: string, output_format: string): string; - } - export function createVerify(algorith: string): Verify; - export interface Verify extends NodeJS.WritableStream { - update(data: any): void; - verify(object: string, signature: string, signature_format?: string): boolean; - } - export function createDiffieHellman(prime_length: number): DiffieHellman; - export function createDiffieHellman(prime: number, encoding?: string): DiffieHellman; - export interface DiffieHellman { - generateKeys(encoding?: string): string; - computeSecret(other_public_key: string, input_encoding?: string, output_encoding?: string): string; - getPrime(encoding?: string): string; - getGenerator(encoding: string): string; - getPublicKey(encoding?: string): string; - getPrivateKey(encoding?: string): string; - setPublicKey(public_key: string, encoding?: string): void; - setPrivateKey(public_key: string, encoding?: string): void; - } - export function getDiffieHellman(group_name: string): DiffieHellman; - export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, callback: (err: Error, derivedKey: Buffer) => any): void; - export function pbkdf2(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void; - export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number) : Buffer; - export function pbkdf2Sync(password: string|Buffer, salt: string|Buffer, iterations: number, keylen: number, digest: string) : Buffer; - export function randomBytes(size: number): Buffer; - export function randomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; - export function pseudoRandomBytes(size: number): Buffer; - export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) =>void ): void; - export interface RsaPublicKey { - key: string; - padding?: any; - } - export interface RsaPrivateKey { - key: string; - passphrase?: string, - padding?: any; - } - export function publicEncrypt(public_key: string|RsaPublicKey, buffer: Buffer): Buffer - export function privateDecrypt(private_key: string|RsaPrivateKey, buffer: Buffer): Buffer -} - -declare module "stream" { - import * as events from "events"; - - export class Stream extends events.EventEmitter { - pipe(destination: T, options?: { end?: boolean; }): T; - } - - export interface ReadableOptions { - highWaterMark?: number; - encoding?: string; - objectMode?: boolean; - } - - export class Readable extends events.EventEmitter implements NodeJS.ReadableStream { - readable: boolean; - constructor(opts?: ReadableOptions); - _read(size: number): void; - read(size?: number): any; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: T): void; - unshift(chunk: any): void; - wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; - push(chunk: any, encoding?: string): boolean; - } - - export interface WritableOptions { - highWaterMark?: number; - decodeStrings?: boolean; - objectMode?: boolean; - } - - export class Writable extends events.EventEmitter implements NodeJS.WritableStream { - writable: boolean; - constructor(opts?: WritableOptions); - _write(chunk: any, encoding: string, callback: Function): void; - write(chunk: any, cb?: Function): boolean; - write(chunk: any, encoding?: string, cb?: Function): boolean; - end(): void; - end(chunk: any, cb?: Function): void; - end(chunk: any, encoding?: string, cb?: Function): void; - } - - export interface DuplexOptions extends ReadableOptions, WritableOptions { - allowHalfOpen?: boolean; - } - - // Note: Duplex extends both Readable and Writable. - export class Duplex extends Readable implements NodeJS.ReadWriteStream { - writable: boolean; - constructor(opts?: DuplexOptions); - _write(chunk: any, encoding: string, callback: Function): void; - write(chunk: any, cb?: Function): boolean; - write(chunk: any, encoding?: string, cb?: Function): boolean; - end(): void; - end(chunk: any, cb?: Function): void; - end(chunk: any, encoding?: string, cb?: Function): void; - } - - export interface TransformOptions extends ReadableOptions, WritableOptions {} - - // Note: Transform lacks the _read and _write methods of Readable/Writable. - export class Transform extends events.EventEmitter implements NodeJS.ReadWriteStream { - readable: boolean; - writable: boolean; - constructor(opts?: TransformOptions); - _transform(chunk: any, encoding: string, callback: Function): void; - _flush(callback: Function): void; - read(size?: number): any; - setEncoding(encoding: string): void; - pause(): void; - resume(): void; - pipe(destination: T, options?: { end?: boolean; }): T; - unpipe(destination?: T): void; - unshift(chunk: any): void; - wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream; - push(chunk: any, encoding?: string): boolean; - write(chunk: any, cb?: Function): boolean; - write(chunk: any, encoding?: string, cb?: Function): boolean; - end(): void; - end(chunk: any, cb?: Function): void; - end(chunk: any, encoding?: string, cb?: Function): void; - } - - export class PassThrough extends Transform {} -} - -declare module "util" { - export interface InspectOptions { - showHidden?: boolean; - depth?: number; - colors?: boolean; - customInspect?: boolean; - } - - export function format(format: any, ...param: any[]): string; - export function debug(string: string): void; - export function error(...param: any[]): void; - export function puts(...param: any[]): void; - export function print(...param: any[]): void; - export function log(string: string): void; - export function inspect(object: any, showHidden?: boolean, depth?: number, color?: boolean): string; - export function inspect(object: any, options: InspectOptions): string; - export function isArray(object: any): boolean; - export function isRegExp(object: any): boolean; - export function isDate(object: any): boolean; - export function isError(object: any): boolean; - export function inherits(constructor: any, superConstructor: any): void; - export function debuglog(key:string): (msg:string,...param: any[])=>void; -} - -declare module "assert" { - function internal (value: any, message?: string): void; - namespace internal { - export class AssertionError implements Error { - name: string; - message: string; - actual: any; - expected: any; - operator: string; - generatedMessage: boolean; - - constructor(options?: {message?: string; actual?: any; expected?: any; - operator?: string; stackStartFunction?: Function}); - } - - export function fail(actual?: any, expected?: any, message?: string, operator?: string): void; - export function ok(value: any, message?: string): void; - export function equal(actual: any, expected: any, message?: string): void; - export function notEqual(actual: any, expected: any, message?: string): void; - export function deepEqual(actual: any, expected: any, message?: string): void; - export function notDeepEqual(acutal: any, expected: any, message?: string): void; - export function strictEqual(actual: any, expected: any, message?: string): void; - export function notStrictEqual(actual: any, expected: any, message?: string): void; - export function deepStrictEqual(actual: any, expected: any, message?: string): void; - export function notDeepStrictEqual(actual: any, expected: any, message?: string): void; - export var throws: { - (block: Function, message?: string): void; - (block: Function, error: Function, message?: string): void; - (block: Function, error: RegExp, message?: string): void; - (block: Function, error: (err: any) => boolean, message?: string): void; - }; - - export var doesNotThrow: { - (block: Function, message?: string): void; - (block: Function, error: Function, message?: string): void; - (block: Function, error: RegExp, message?: string): void; - (block: Function, error: (err: any) => boolean, message?: string): void; - }; - - export function ifError(value: any): void; - } - - export = internal; -} - -declare module "tty" { - import * as net from "net"; - - export function isatty(fd: number): boolean; - export interface ReadStream extends net.Socket { - isRaw: boolean; - setRawMode(mode: boolean): void; - isTTY: boolean; - } - export interface WriteStream extends net.Socket { - columns: number; - rows: number; - isTTY: boolean; - } -} - -declare module "domain" { - import * as events from "events"; - - export class Domain extends events.EventEmitter implements NodeJS.Domain { - run(fn: Function): void; - add(emitter: events.EventEmitter): void; - remove(emitter: events.EventEmitter): void; - bind(cb: (err: Error, data: any) => any): any; - intercept(cb: (data: any) => any): any; - dispose(): void; - } - - export function create(): Domain; -} - -declare module "constants" { - export var E2BIG: number; - export var EACCES: number; - export var EADDRINUSE: number; - export var EADDRNOTAVAIL: number; - export var EAFNOSUPPORT: number; - export var EAGAIN: number; - export var EALREADY: number; - export var EBADF: number; - export var EBADMSG: number; - export var EBUSY: number; - export var ECANCELED: number; - export var ECHILD: number; - export var ECONNABORTED: number; - export var ECONNREFUSED: number; - export var ECONNRESET: number; - export var EDEADLK: number; - export var EDESTADDRREQ: number; - export var EDOM: number; - export var EEXIST: number; - export var EFAULT: number; - export var EFBIG: number; - export var EHOSTUNREACH: number; - export var EIDRM: number; - export var EILSEQ: number; - export var EINPROGRESS: number; - export var EINTR: number; - export var EINVAL: number; - export var EIO: number; - export var EISCONN: number; - export var EISDIR: number; - export var ELOOP: number; - export var EMFILE: number; - export var EMLINK: number; - export var EMSGSIZE: number; - export var ENAMETOOLONG: number; - export var ENETDOWN: number; - export var ENETRESET: number; - export var ENETUNREACH: number; - export var ENFILE: number; - export var ENOBUFS: number; - export var ENODATA: number; - export var ENODEV: number; - export var ENOENT: number; - export var ENOEXEC: number; - export var ENOLCK: number; - export var ENOLINK: number; - export var ENOMEM: number; - export var ENOMSG: number; - export var ENOPROTOOPT: number; - export var ENOSPC: number; - export var ENOSR: number; - export var ENOSTR: number; - export var ENOSYS: number; - export var ENOTCONN: number; - export var ENOTDIR: number; - export var ENOTEMPTY: number; - export var ENOTSOCK: number; - export var ENOTSUP: number; - export var ENOTTY: number; - export var ENXIO: number; - export var EOPNOTSUPP: number; - export var EOVERFLOW: number; - export var EPERM: number; - export var EPIPE: number; - export var EPROTO: number; - export var EPROTONOSUPPORT: number; - export var EPROTOTYPE: number; - export var ERANGE: number; - export var EROFS: number; - export var ESPIPE: number; - export var ESRCH: number; - export var ETIME: number; - export var ETIMEDOUT: number; - export var ETXTBSY: number; - export var EWOULDBLOCK: number; - export var EXDEV: number; - export var WSAEINTR: number; - export var WSAEBADF: number; - export var WSAEACCES: number; - export var WSAEFAULT: number; - export var WSAEINVAL: number; - export var WSAEMFILE: number; - export var WSAEWOULDBLOCK: number; - export var WSAEINPROGRESS: number; - export var WSAEALREADY: number; - export var WSAENOTSOCK: number; - export var WSAEDESTADDRREQ: number; - export var WSAEMSGSIZE: number; - export var WSAEPROTOTYPE: number; - export var WSAENOPROTOOPT: number; - export var WSAEPROTONOSUPPORT: number; - export var WSAESOCKTNOSUPPORT: number; - export var WSAEOPNOTSUPP: number; - export var WSAEPFNOSUPPORT: number; - export var WSAEAFNOSUPPORT: number; - export var WSAEADDRINUSE: number; - export var WSAEADDRNOTAVAIL: number; - export var WSAENETDOWN: number; - export var WSAENETUNREACH: number; - export var WSAENETRESET: number; - export var WSAECONNABORTED: number; - export var WSAECONNRESET: number; - export var WSAENOBUFS: number; - export var WSAEISCONN: number; - export var WSAENOTCONN: number; - export var WSAESHUTDOWN: number; - export var WSAETOOMANYREFS: number; - export var WSAETIMEDOUT: number; - export var WSAECONNREFUSED: number; - export var WSAELOOP: number; - export var WSAENAMETOOLONG: number; - export var WSAEHOSTDOWN: number; - export var WSAEHOSTUNREACH: number; - export var WSAENOTEMPTY: number; - export var WSAEPROCLIM: number; - export var WSAEUSERS: number; - export var WSAEDQUOT: number; - export var WSAESTALE: number; - export var WSAEREMOTE: number; - export var WSASYSNOTREADY: number; - export var WSAVERNOTSUPPORTED: number; - export var WSANOTINITIALISED: number; - export var WSAEDISCON: number; - export var WSAENOMORE: number; - export var WSAECANCELLED: number; - export var WSAEINVALIDPROCTABLE: number; - export var WSAEINVALIDPROVIDER: number; - export var WSAEPROVIDERFAILEDINIT: number; - export var WSASYSCALLFAILURE: number; - export var WSASERVICE_NOT_FOUND: number; - export var WSATYPE_NOT_FOUND: number; - export var WSA_E_NO_MORE: number; - export var WSA_E_CANCELLED: number; - export var WSAEREFUSED: number; - export var SIGHUP: number; - export var SIGINT: number; - export var SIGILL: number; - export var SIGABRT: number; - export var SIGFPE: number; - export var SIGKILL: number; - export var SIGSEGV: number; - export var SIGTERM: number; - export var SIGBREAK: number; - export var SIGWINCH: number; - export var SSL_OP_ALL: number; - export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; - export var SSL_OP_CIPHER_SERVER_PREFERENCE: number; - export var SSL_OP_CISCO_ANYCONNECT: number; - export var SSL_OP_COOKIE_EXCHANGE: number; - export var SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; - export var SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; - export var SSL_OP_EPHEMERAL_RSA: number; - export var SSL_OP_LEGACY_SERVER_CONNECT: number; - export var SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; - export var SSL_OP_MICROSOFT_SESS_ID_BUG: number; - export var SSL_OP_MSIE_SSLV2_RSA_PADDING: number; - export var SSL_OP_NETSCAPE_CA_DN_BUG: number; - export var SSL_OP_NETSCAPE_CHALLENGE_BUG: number; - export var SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; - export var SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; - export var SSL_OP_NO_COMPRESSION: number; - export var SSL_OP_NO_QUERY_MTU: number; - export var SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; - export var SSL_OP_NO_SSLv2: number; - export var SSL_OP_NO_SSLv3: number; - export var SSL_OP_NO_TICKET: number; - export var SSL_OP_NO_TLSv1: number; - export var SSL_OP_NO_TLSv1_1: number; - export var SSL_OP_NO_TLSv1_2: number; - export var SSL_OP_PKCS1_CHECK_1: number; - export var SSL_OP_PKCS1_CHECK_2: number; - export var SSL_OP_SINGLE_DH_USE: number; - export var SSL_OP_SINGLE_ECDH_USE: number; - export var SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; - export var SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; - export var SSL_OP_TLS_BLOCK_PADDING_BUG: number; - export var SSL_OP_TLS_D5_BUG: number; - export var SSL_OP_TLS_ROLLBACK_BUG: number; - export var ENGINE_METHOD_DSA: number; - export var ENGINE_METHOD_DH: number; - export var ENGINE_METHOD_RAND: number; - export var ENGINE_METHOD_ECDH: number; - export var ENGINE_METHOD_ECDSA: number; - export var ENGINE_METHOD_CIPHERS: number; - export var ENGINE_METHOD_DIGESTS: number; - export var ENGINE_METHOD_STORE: number; - export var ENGINE_METHOD_PKEY_METHS: number; - export var ENGINE_METHOD_PKEY_ASN1_METHS: number; - export var ENGINE_METHOD_ALL: number; - export var ENGINE_METHOD_NONE: number; - export var DH_CHECK_P_NOT_SAFE_PRIME: number; - export var DH_CHECK_P_NOT_PRIME: number; - export var DH_UNABLE_TO_CHECK_GENERATOR: number; - export var DH_NOT_SUITABLE_GENERATOR: number; - export var NPN_ENABLED: number; - export var RSA_PKCS1_PADDING: number; - export var RSA_SSLV23_PADDING: number; - export var RSA_NO_PADDING: number; - export var RSA_PKCS1_OAEP_PADDING: number; - export var RSA_X931_PADDING: number; - export var RSA_PKCS1_PSS_PADDING: number; - export var POINT_CONVERSION_COMPRESSED: number; - export var POINT_CONVERSION_UNCOMPRESSED: number; - export var POINT_CONVERSION_HYBRID: number; - export var O_RDONLY: number; - export var O_WRONLY: number; - export var O_RDWR: number; - export var S_IFMT: number; - export var S_IFREG: number; - export var S_IFDIR: number; - export var S_IFCHR: number; - export var S_IFLNK: number; - export var O_CREAT: number; - export var O_EXCL: number; - export var O_TRUNC: number; - export var O_APPEND: number; - export var F_OK: number; - export var R_OK: number; - export var W_OK: number; - export var X_OK: number; - export var UV_UDP_REUSEADDR: number; -} diff --git a/templates/yeoman/typings/rimraf/rimraf.d.ts b/templates/yeoman/typings/rimraf/rimraf.d.ts deleted file mode 100644 index 5df8b9b8..00000000 --- a/templates/yeoman/typings/rimraf/rimraf.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -// Type definitions for rimraf -// Project: https://github.com/isaacs/rimraf -// Definitions by: Carlos Ballesteros Velasco -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// Imported from: https://github.com/soywiz/typescript-node-definitions/rimraf.d.ts - -declare module "rimraf" { - function rimraf(path: string, callback: (error: Error) => void): void; - namespace rimraf { - export function sync(path: string): void; - export var EMFILE_MAX: number; - export var BUSYTRIES_MAX: number; - } - export = rimraf; -} diff --git a/templates/yeoman/typings/tsd.d.ts b/templates/yeoman/typings/tsd.d.ts deleted file mode 100644 index dbcb9620..00000000 --- a/templates/yeoman/typings/tsd.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// diff --git a/templates/yeoman/typings/yeoman-generator/yeoman-generator.d.ts b/templates/yeoman/typings/yeoman-generator/yeoman-generator.d.ts deleted file mode 100644 index 68ec035c..00000000 --- a/templates/yeoman/typings/yeoman-generator/yeoman-generator.d.ts +++ /dev/null @@ -1,250 +0,0 @@ -// Type definitions for yeoman-generator -// Project: https://github.com/yeoman/generator -// Definitions by: Kentaro Okuno -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - -declare namespace yo { - export interface IYeomanGenerator { - argument(name: string, config: IArgumentConfig): void; - composeWith(namespace: string, options: any, settings?: IComposeSetting): IYeomanGenerator; - defaultFor(name: string): void; - destinationRoot(rootPath?: string): string; - destinationPath(...path: string[]): string; - determineAppname(): void; - getCollisionFilter(): (output: any) => void; - hookFor(name: string, config: IHookConfig): void; - option(name: string, config: IYeomanGeneratorOption): void; - rootGeneratorName(): string; - run(args?: any): void; - run(args: any, callback?: Function): void; - runHooks(callback?: Function): void; - sourceRoot(rootPath?: string): string; - templatePath(...path: string[]): string; - prompt(opt: IPromptOptions | IPromptOptions[], callback: (answers: any) => void): void; - npmInstall(packages?: string[] | string, options?: any, cb?: Function): void; - installDependencies(options?: IInstallDependencyOptions): void; - spawnCommand(name: string, args?: string[], options?: Object): void; - spawnCommandSync(name: string, args?: string[], options?: Object): void; - options: { [key: string]: any }; - fs: IMemFsEditor; - } - - export class YeomanGeneratorBase implements IYeomanGenerator, NodeJS.EventEmitter { - argument(name: string, config: IArgumentConfig): void; - composeWith(namespace: string, options: any, settings?: IComposeSetting): IYeomanGenerator; - defaultFor(name: string): void; - destinationRoot(rootPath?: string): string; - destinationPath(...path: string[]): string; - determineAppname(): void; - getCollisionFilter(): (output: any) => void; - hookFor(name: string, config: IHookConfig): void; - option(name: string, config?: IYeomanGeneratorOption): void; - rootGeneratorName(): string; - run(args?: any): void; - run(args: any, callback?: Function): void; - runHooks(callback?: Function): void; - sourceRoot(rootPath?: string): string; - templatePath(...path: string[]): string; - addListener(event: string, listener: Function): this; - on(event: string, listener: Function): this; - once(event: string, listener: Function): this; - removeListener(event: string, listener: Function): this; - removeAllListeners(event?: string): this; - setMaxListeners(n: number): this; - getMaxListeners(): number; - listeners(event: string): Function[]; - emit(event: string, ...args: any[]): boolean; - listenerCount(type: string): number; - - async(): any; - prompt(opt: IPromptOptions | IPromptOptions[], callback: (answers: any) => void): void; - log(message: string) : void; - npmInstall(packages: string[], options?: any, cb?: Function) :void; - installDependencies(options?: IInstallDependencyOptions): void; - spawnCommand(name: string, args?: string[], options?: Object): void; - spawnCommandSync(name: string, args?: string[], options?: Object): void; - - appname: string; - gruntfile: IGruntFileStatic; - options: { [key: string]: any }; - fs: IMemFsEditor; - } - - export interface IMemFsEditor { - read(filepath: string, options?: Object): string; - readJSON(filepath: string, defaults?: Object): Object; - write(filepath: string, contents: string): void; - writeJSON(filepath: string, contents: Object, replacer?: Function, space?: number): void; - delete(filepath: string, options?: Object): void; - copy(from: string, to: string, options?: Object): void; - copyTpl(from: string, to: string, context: Object, options?: Object): void; - move(from: string, to: string, options?: Object): void; - exists(filepath: string): boolean; - commit(callback: Function): void; - commit(filters: any[], callback: Function): void; - } - - export interface IInstallDependencyOptions { - npm?: boolean; - bower?: boolean; - skipMessage?: boolean; - callback?: Function; - } - - export interface IChoice { - name: string; - value: string; - short?: string; - } - - export interface IPromptOptions{ - type?: string; - name: string; - message: string | ((answers: Object) => string); - choices?: any[] | ((answers: Object) => any); - default?: string | number | string[] | number[] | ((answers: Object) => (string | number | string[] | number[])); - validate?: ((input: any) => boolean | string); - filter?: ((input: any) => any); - when?: ((answers: Object) => boolean) | boolean; - store?: boolean; - } - - export interface IGruntFileStatic { - loadNpmTasks(pluginName: string): void; - insertConfig(name:string, config:any):void; - registerTask(name:string, tasks:any):void; - insertVariable(name:string, value:any):void; - prependJavaScript(code:string):void; - } - - export interface IArgumentConfig { - desc: string; - required?: boolean; - optional?: boolean; - type: any; - defaults?: any; - } - - export interface IComposeSetting { - local?: string; - link?: string; - } - - export interface IHookConfig { - as: string; - args: any; - options: any; - } - - export interface IYeomanGeneratorOption { - alias?: string; - defaults?: any; - desc?: string; - hide?: boolean; - type?: any; - } - - export interface IQueueProps { - initializing: () => void; - prompting?: () => void; - configuring?: () => void; - default?: () => void; - writing: { - [target: string]: () => void; - }; - conflicts?: () => void; - install?: () => void; - end: () => void; - } - - export interface INamedBase extends IYeomanGenerator { - } - - export interface IBase extends INamedBase { - } - - export interface IAssert { - file(path: string): void; - file(paths: string[]): void; - fileContent(file: string, reg: RegExp): void; - - /** @param {[String, RegExp][]} pairs */ - fileContent(pairs: any[][]): void; - - /** @param {[String, RegExp][]|String[]} pairs */ - files(pairs: any[]): void; - - /** - * @param {Object} subject - * @param {Object|Array} methods - */ - implement(subject: any, methods: any): void; - noFile(file: string): void; - noFileContent(file: string, reg: RegExp): void; - - /** @param {[String, RegExp][]} pairs */ - noFileContent(pairs: any[][]): void; - - /** - * @param {Object} subject - * @param {Object|Array} methods - */ - noImplement(subject: any, methods: any): void; - - textEqual(value: string, expected: string): void; - } - - export interface ITestHelper { - createDummyGenerator(): IYeomanGenerator; - createGenerator(name: string, dependencies: any[], args: any, options: any): IYeomanGenerator; - decorate(context: any, method: string, replacement: Function, options: any): void; - gruntfile(options: any, done: Function): void; - mockPrompt(generator: IYeomanGenerator, answers: any): void; - registerDependencies(dependencies: string[]): void; - restore(): void; - - /** @param {String|Function} generator */ - run(generator: any): IRunContext; - } - - export interface IRunContext { - async(): Function; - inDir(dirPath: string): IRunContext; - - /** @param {String|String[]} args */ - withArguments(args: any): IRunContext; - withGenerators(dependencies: string[]): IRunContext; - withOptions(options: any): IRunContext; - withPrompts(answers: any): IRunContext; - } - - /** @type file file-utils */ - var file: any; - var assert: IAssert; - var test: ITestHelper; - - // "generators" is deprecated - namespace generators { - - export class NamedBase extends YeomanGeneratorBase implements INamedBase { - constructor(args: string | string[], options: any); - } - - export class Base extends NamedBase implements IBase { - static extend(protoProps: IQueueProps, staticProps?: any): IYeomanGenerator; - } - } - - export class NamedBase extends YeomanGeneratorBase implements INamedBase { - constructor(args: string | string[], options: any); - } - - export class Base extends NamedBase implements IBase { - static extend(protoProps: IQueueProps, staticProps?: any): IYeomanGenerator; - } -} - -declare module "yeoman-generator" { - export = yo; -} diff --git a/version.props b/version.props new file mode 100644 index 00000000..71a78cdd --- /dev/null +++ b/version.props @@ -0,0 +1,12 @@ + + + 3.0.0 + alpha1 + $(VersionPrefix) + $(VersionPrefix)-$(VersionSuffix)-final + t000 + a- + $(FeatureBranchVersionPrefix)$(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-')) + $(VersionSuffix)-$(BuildNumber) + +
    -
    - -
    -

    {{ albumData.Artist.Name }}

    -
    -
    -
    - -
    -

    {{ albumData.Genre.Name }}

    -
    -
    -
    - -
    -

    {{ albumData.Title }}

    -
    -
    -
    - -
    -

    {{ albumData.Price | currency:'USD':true }}

    -
    -
    -
    - -
    -

    {{ albumData.AlbumArtUrl }}

    -
    -
    -
    - -
    - {{ albumData.Title }} -
    -
    -
    -
    - Edit - - Back to List -
    -
    -