@types/ink-gradient
TypeScript icon, indicating that this package has built-in type declarations

2.0.4 • Public • Published

Installation

npm install --save @types/ink-gradient

Summary

This package contains type definitions for ink-gradient (https://github.com/sindresorhus/ink-gradient).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ink-gradient.

index.d.ts

import * as React from "react";

// This needs to be updated when TypeScript enhances their support for mutual
// exclusivity in properties. This edit I made will now throw errors when
// a user gives both of the mutually exclusive props.

type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
type XOR<T, U> = T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;

interface PropsName {
    name:
        | "cristal"
        | "teen"
        | "mind"
        | "morning"
        | "vice"
        | "passion"
        | "fruit"
        | "instagram"
        | "atlas"
        | "retro"
        | "summer"
        | "pastel"
        | "rainbow";
}

// note, object[] in this case refers to objects interpretable by tinycolor2
interface PropsColor {
    colors: string[] | object[];
}

type GradientProps = XOR<PropsName, PropsColor> & { children: React.ReactNode };

declare const Gradient: React.FC<GradientProps>;
export = Gradient;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: @types/react

Credits

These definitions were written by aaronleopold.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/ink-gradient

Weekly Downloads

1,481

Version

2.0.4

License

MIT

Unpacked Size

4.59 kB

Total Files

5

Last publish

Collaborators

  • types