mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Merge pull request #31887 from anton-drobot/react-loadable
[react-loadable] Ability to import Bundle, Manifest and ReactLoadablePluginOptions
This commit is contained in:
commit
d2defa0da5
2
types/react-loadable/index.d.ts
vendored
2
types/react-loadable/index.d.ts
vendored
@ -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 <https://github.com/Kovensky>
|
||||
// Oden S. <https://github.com/odensc>
|
||||
|
||||
@ -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'
|
||||
|
||||
41
types/react-loadable/webpack.d.ts
vendored
41
types/react-loadable/webpack.d.ts
vendored
@ -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 {
|
||||
id: number;
|
||||
name: string;
|
||||
export interface Bundle {
|
||||
id: string;
|
||||
name: string | null;
|
||||
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[];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user