From eb98ab858fb7d4c1a3e5eacd99494afdefeda5cd Mon Sep 17 00:00:00 2001 From: Anton Drobot Date: Fri, 4 Jan 2019 14:50:54 +0300 Subject: [PATCH 1/4] [react-loadable] export everything in webpack.d.ts --- types/react-loadable/webpack.d.ts | 37 ++++++++++++------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/types/react-loadable/webpack.d.ts b/types/react-loadable/webpack.d.ts index 59e046a975..c9a95ec2f9 100644 --- a/types/react-loadable/webpack.d.ts +++ b/types/react-loadable/webpack.d.ts @@ -1,31 +1,22 @@ -import webpack = require("webpack"); +import webpack = require('webpack'); -declare namespace LoadableExport { - interface Options { - filename: string; - } - - class ReactLoadablePlugin extends webpack.Plugin { - constructor(opts?: Options); - } - - interface Bundle { +export interface Bundle { id: number; name: string; file: string; publicPath: string; - } - - interface Manifest { - [moduleId: string]: Bundle[]; - } - - function getBundles(manifest: Manifest, moduleIds: string[]): Bundle[]; } -declare const exports: { - getBundles: typeof LoadableExport.getBundles; - ReactLoadablePlugin: typeof LoadableExport.ReactLoadablePlugin; -}; +export interface Manifest { + [moduleId: string]: Bundle[]; +} -export = exports; +export interface ReactLoadablePluginOptions { + filename: string; +} + +export class ReactLoadablePlugin extends webpack.Plugin { + constructor(opts?: ReactLoadablePluginOptions); +} + +export function getBundles(manifest: Manifest, moduleIds: string[]): Bundle[]; From 1d66dc3d9e0fd8622e796dd0f1f09407dac533a2 Mon Sep 17 00:00:00 2001 From: Anton Drobot Date: Fri, 4 Jan 2019 14:51:49 +0300 Subject: [PATCH 2/4] [react-loadable] change type for id in Bundle interface --- types/react-loadable/test/webpack.ts | 2 +- types/react-loadable/webpack.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-loadable/test/webpack.ts b/types/react-loadable/test/webpack.ts index c6c95f8af0..4ce672e49f 100644 --- a/types/react-loadable/test/webpack.ts +++ b/types/react-loadable/test/webpack.ts @@ -13,7 +13,7 @@ const config: webpack.Configuration = { const manifest = { react: [ { - id: 0, + id: './node_modules/react/index.js', name: './node_modules/react/index.js', file: 'main.js', publicPath: 'http://127.0.0.1/main.js' diff --git a/types/react-loadable/webpack.d.ts b/types/react-loadable/webpack.d.ts index c9a95ec2f9..9146cdabac 100644 --- a/types/react-loadable/webpack.d.ts +++ b/types/react-loadable/webpack.d.ts @@ -1,7 +1,7 @@ import webpack = require('webpack'); export interface Bundle { - id: number; + id: string; name: string; file: string; publicPath: string; From 0d43f21cce47d2988410130db09284704ed39bc9 Mon Sep 17 00:00:00 2001 From: Anton Drobot Date: Fri, 4 Jan 2019 14:52:18 +0300 Subject: [PATCH 3/4] [react-loadable] change type for name in Bundle interface --- types/react-loadable/webpack.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-loadable/webpack.d.ts b/types/react-loadable/webpack.d.ts index 9146cdabac..35c8e44aad 100644 --- a/types/react-loadable/webpack.d.ts +++ b/types/react-loadable/webpack.d.ts @@ -2,7 +2,7 @@ import webpack = require('webpack'); export interface Bundle { id: string; - name: string; + name: string | null; file: string; publicPath: string; } From 1e42d375eb73a8efb3c46a8e31ea64717ffb6b73 Mon Sep 17 00:00:00 2001 From: Anton Drobot Date: Fri, 4 Jan 2019 14:52:45 +0300 Subject: [PATCH 4/4] [react-loadable] bump react-loadable version to 5.5 --- types/react-loadable/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-loadable/index.d.ts b/types/react-loadable/index.d.ts index bf8af8e794..8661716e75 100644 --- a/types/react-loadable/index.d.ts +++ b/types/react-loadable/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-loadable 5.4 +// Type definitions for react-loadable 5.5 // Project: https://github.com/thejameskyle/react-loadable#readme // Definitions by: Jessica Franco // Oden S.