mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add new typings for favicons-webpack-plugin@1.0 (#38782)
This commit is contained in:
parent
ee1a310306
commit
4f4381c06b
@ -0,0 +1,51 @@
|
||||
import FaviconsWebpackPlugin = require('favicons-webpack-plugin');
|
||||
|
||||
new FaviconsWebpackPlugin();
|
||||
|
||||
new FaviconsWebpackPlugin('/path/to/logo.png');
|
||||
|
||||
const optionsArray: FaviconsWebpackPlugin.Options[] = [
|
||||
// Default parameters
|
||||
{
|
||||
logo: '/path/to/logo.png',
|
||||
cache: true,
|
||||
inject: true,
|
||||
favicons: {},
|
||||
prefix: 'assets/',
|
||||
},
|
||||
// "Advanced Usage" example from documentation
|
||||
{
|
||||
logo: '/path/to/logo.png',
|
||||
cache: true,
|
||||
publicPath: '/static',
|
||||
outputPath: '/public/static',
|
||||
prefix: 'assets/',
|
||||
inject: true,
|
||||
favicons: {},
|
||||
},
|
||||
// "Basic" example from documentation
|
||||
{
|
||||
logo: '/path/to/logo.png',
|
||||
mode: 'webapp',
|
||||
devMode: 'webapp',
|
||||
favicons: {
|
||||
appName: 'my-app',
|
||||
appDescription: 'My awesome App',
|
||||
developerName: 'Me',
|
||||
developerURL: null,
|
||||
background: '#ddd',
|
||||
theme_color: '#333',
|
||||
icons: {
|
||||
coast: false,
|
||||
yandex: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
// "Handling Multiple HTML Files" example from documentation
|
||||
{
|
||||
logo: 'logo.svg',
|
||||
inject: htmlPlugin => htmlPlugin.options.filename === 'a.html',
|
||||
},
|
||||
];
|
||||
|
||||
const plugins: FaviconsWebpackPlugin[] = optionsArray.map(options => new FaviconsWebpackPlugin(options));
|
||||
31
types/favicons-webpack-plugin/index.d.ts
vendored
Normal file
31
types/favicons-webpack-plugin/index.d.ts
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
// Type definitions for favicons-webpack-plugin 1.0
|
||||
// Project: https://github.com/jantimon/favicons-webpack-plugin
|
||||
// Definitions by: Paweł Meller <https://github.com/pmeller>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { Plugin } from 'webpack';
|
||||
import { Configuration as FaviconsConfiguration } from 'favicons';
|
||||
import HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
export = FaviconsWebpackPlugin;
|
||||
|
||||
declare class FaviconsWebpackPlugin extends Plugin {
|
||||
constructor(options?: string | FaviconsWebpackPlugin.Options);
|
||||
}
|
||||
|
||||
declare namespace FaviconsWebpackPlugin {
|
||||
type Mode = 'webapp' | 'light';
|
||||
|
||||
interface Options {
|
||||
logo: string;
|
||||
mode?: Mode;
|
||||
devMode?: Mode;
|
||||
cache?: boolean;
|
||||
publicPath?: string;
|
||||
outputPath?: string;
|
||||
prefix?: string;
|
||||
inject?: boolean | ((htmlPlugin: HtmlWebpackPlugin & { options: HtmlWebpackPlugin.Options }) => boolean);
|
||||
favicons?: Partial<FaviconsConfiguration>;
|
||||
}
|
||||
}
|
||||
23
types/favicons-webpack-plugin/tsconfig.json
Normal file
23
types/favicons-webpack-plugin/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"favicons-webpack-plugin-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/favicons-webpack-plugin/tslint.json
Normal file
1
types/favicons-webpack-plugin/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user