Adding autoprefixer-core

This is actually more useful than autoprefixer since this is the
programmatic interface
This commit is contained in:
Phips Peter 2015-05-20 17:00:13 -07:00
parent d67c5e3e1a
commit 8bc91d57f6
2 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,9 @@
/// <reference path="autoprefixer-core.d.ts" />
import autoprefixer = require("autoprefixer-core");
var css: string;
var prefixed = autoprefixer.process(css).css;
var processor = autoprefixer({ browsers: ['> 1%', 'IE 7'], cascade: false });
console.log(processor.info());

View File

@ -0,0 +1,44 @@
// Type definitions for Autoprefixer Core 5.1.11
// Project: https://github.com/postcss/autoprefixer-core
// Definitions by: Asana <https://asana.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "autoprefixer-core" {
interface Config {
browsers?: string[];
cascade?: boolean;
remove?: boolean;
}
interface Options {
from?: string;
to?: string;
safe?: boolean;
map?: {
inline?: boolean;
prev?: string | Object;
}
}
interface Result {
css: string;
map: string;
opts: Options;
}
interface Processor {
postcss: any;
info(): string;
process(css: string, opts?: Options): Result;
}
interface Exports {
(config: Config): Processor;
postcss: any;
info(): string;
process(css: string, opts?: Options): Result;
}
var exports: Exports;
export = exports;
}