From 8bc91d57f68517ccea6c50b30f4a3e8ffe2bd97b Mon Sep 17 00:00:00 2001 From: Phips Peter Date: Wed, 20 May 2015 17:00:13 -0700 Subject: [PATCH] Adding autoprefixer-core This is actually more useful than autoprefixer since this is the programmatic interface --- autoprefixer-core/autoprefixer-core-tests.ts | 9 ++++ autoprefixer-core/autoprefixer-core.d.ts | 44 ++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 autoprefixer-core/autoprefixer-core-tests.ts create mode 100644 autoprefixer-core/autoprefixer-core.d.ts diff --git a/autoprefixer-core/autoprefixer-core-tests.ts b/autoprefixer-core/autoprefixer-core-tests.ts new file mode 100644 index 0000000000..9ff4e7695f --- /dev/null +++ b/autoprefixer-core/autoprefixer-core-tests.ts @@ -0,0 +1,9 @@ +/// +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()); diff --git a/autoprefixer-core/autoprefixer-core.d.ts b/autoprefixer-core/autoprefixer-core.d.ts new file mode 100644 index 0000000000..905447acfa --- /dev/null +++ b/autoprefixer-core/autoprefixer-core.d.ts @@ -0,0 +1,44 @@ +// Type definitions for Autoprefixer Core 5.1.11 +// Project: https://github.com/postcss/autoprefixer-core +// Definitions by: Asana +// 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; +}