css-color-function icon indicating copy to clipboard operation
css-color-function copied to clipboard

add index.ts.d

Open morlay opened this issue 9 years ago • 0 comments

index.ts.d

    type Adjusters = 'red' | 'green' | 'blue' | 'alpha' | 'a' // RGBA
        | 'hue' | 'h' | 'saturation' | 's' | 'lightness' | 'l' | 'whiteness' | 'w' | 'blackness' | 'b' // HSLWB;
        | 'blend' | 'tint' | 'shade' | 'contrast'

    interface Modifier {
        type: 'modifier';
        value: string;
    }

    interface Number {
        type: 'number';
        value: string;
    }

    interface Color {
        type: 'color';
        value: string;
    }

    interface Adjuster {
        type: 'function';
        name: Adjusters;
        arguments: Array<Modifier | Number | ColorFunction>;
    }

    interface ColorFunction {
        type: 'function';
        name: 'color';
        arguments: Array<Color | Adjuster>
    }

    export function convert(val: string): string

    export function parse(val: string): ColorFunction | Modifier | Number | Adjuster

Just manual types. not sure is this enough.

morlay avatar Nov 29 '16 15:11 morlay