mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add typings for webpackbar
This commit is contained in:
parent
9fb3214e64
commit
6249fa61e2
61
types/webpackbar/index.d.ts
vendored
Normal file
61
types/webpackbar/index.d.ts
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
// Type definitions for webpackbar 2.6
|
||||
// Project: https://github.com/nuxt/webpackbar
|
||||
// Definitions by: Ryan Clark <https://github.com/rynclark>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Plugin } from 'webpack';
|
||||
|
||||
export = WebpackBar;
|
||||
|
||||
declare class WebpackBar extends Plugin {
|
||||
constructor(options?: WebpackBar.Options);
|
||||
|
||||
state: WebpackBar.State;
|
||||
}
|
||||
|
||||
declare namespace WebpackBar {
|
||||
interface Stats {
|
||||
count: number;
|
||||
time: [number, number];
|
||||
}
|
||||
|
||||
class Profile {
|
||||
requests: any[];
|
||||
|
||||
name: string;
|
||||
|
||||
constructor(name: string);
|
||||
|
||||
getStats(): { ext: Stats, loader: Stats };
|
||||
}
|
||||
|
||||
interface State {
|
||||
isRunning: boolean;
|
||||
color: string;
|
||||
profile: Profile | null;
|
||||
}
|
||||
|
||||
interface SharedState {
|
||||
[name: string]: State;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
/** Display name */
|
||||
name?: string;
|
||||
/** Color output of the progress bar */
|
||||
color?: string;
|
||||
/** Enable the profiler for files and loaders */
|
||||
profile?: boolean;
|
||||
/** Stream to rwite to */
|
||||
stream?: NodeJS.WriteStream;
|
||||
/** Minimal output */
|
||||
minimal?: boolean;
|
||||
/** Show compiled in time */
|
||||
compiledIn?: boolean;
|
||||
/** Function called when all builds are finished */
|
||||
done?: (sharedState: SharedState, ctx: WebpackBar) => void;
|
||||
}
|
||||
}
|
||||
23
types/webpackbar/tsconfig.json
Normal file
23
types/webpackbar/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"webpackbar-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/webpackbar/tslint.json
Normal file
1
types/webpackbar/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
9
types/webpackbar/webpackbar-tests.ts
Normal file
9
types/webpackbar/webpackbar-tests.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import WebpackBar = require('webpackbar');
|
||||
|
||||
new WebpackBar();
|
||||
|
||||
new WebpackBar({ color: '#ff0000' });
|
||||
|
||||
new WebpackBar({ stream: process.stdout });
|
||||
|
||||
new WebpackBar({ done: (sharedState, ctx) => {} });
|
||||
Loading…
Reference in New Issue
Block a user