@types/webpack-config-utils
TypeScript icon, indicating that this package has built-in type declarations

2.3.4 • Public • Published

Installation

npm install --save @types/webpack-config-utils

Summary

This package contains type definitions for webpack-config-utils (https://github.com/kentcdodds/webpack-config-utils#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webpack-config-utils.

index.d.ts

export function getIfUtils<E extends EnvVars | string>(
    env: { [P in E]: boolean | string } | E,
    vars?: Array<EnvVars | string>,
): IfUtils;
export function removeEmpty<T>(input: Array<T | undefined>): T[];
export function removeEmpty<T>(input: { [P in keyof T]: T[P] }): NonEmptyObject<T>;
export function propIf<E>(a: Falsy, value: any, alternate: E): E;
export function propIf<I>(a: any, value: I, alternate: any): I;
export function propIfNot<I>(a: Falsy, value: I, alternate: any): I;
export function propIfNot<E>(a: any, value: any, alternate: E): E;

export type Falsy = false | "" | "false" | undefined | null | 0;
export type DefinedObjKeys<T> = ({ [P in keyof T]: T[P] extends undefined ? never : P })[keyof T];
export type NonEmptyObject<T, P extends DefinedObjKeys<T> = DefinedObjKeys<T>> = { [PP in P]: T[PP] };

export type EnvVars = "production" | "prod" | "test" | "development" | "dev";

export interface IfUtilsFn {
    <Y, N>(value: Y, alternate?: N): Y | N;
    (): boolean;
}
export interface IfUtils {
    ifDevelopment: IfUtilsFn;
    ifNotDevelopment: IfUtilsFn;
    ifDev: IfUtilsFn;
    ifNotDev: IfUtilsFn;
    ifProduction: IfUtilsFn;
    ifNotProduction: IfUtilsFn;
    ifProd: IfUtilsFn;
    ifNotProd: IfUtilsFn;
    ifTest: IfUtilsFn;
    ifNotTest: IfUtilsFn;
    [key: string]: IfUtilsFn;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Martin Hochel.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/webpack-config-utils

Weekly Downloads

314

Version

2.3.4

License

MIT

Unpacked Size

5.3 kB

Total Files

5

Last publish

Collaborators

  • types