Update type definitions for the latest version of inline-style-prefixer (#29426)

* Update inline-style-prefixer-tests.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts
This commit is contained in:
Frank Li 2018-10-09 09:43:52 -07:00 committed by Andy
parent d72804af05
commit fcaad045de
2 changed files with 18 additions and 23 deletions

View File

@ -1,28 +1,25 @@
// Type definitions for inline-style-prefixer 3.0
// Type definitions for inline-style-prefixer 5.0
// Project: https://github.com/rofrischmann/inline-style-prefixer
// Definitions by: Andrej Hazucha <https://github.com/ahz>
// dpetrezselyova <https://github.com/dpetrezselyova>
// Frank Li <https://github.com/franklixuefei>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
declare namespace InlineStylePrefixer {
interface Configuration {
userAgent?: string;
keepUnprefixed?: boolean;
}
export type Plugin = <T>(
property: string,
value: number | string | number[] | string[] | T,
style: T,
prefixMap?: Record<string, string[]>
) => number | string | number[] | string[] | T | undefined;
export interface StaticData {
prefixMap: Record<string, string[]>;
plugins: Plugin[];
}
declare class InlineStylePrefixer {
constructor(cfg?: InlineStylePrefixer.Configuration);
export type Prefix = <T>(style: T) => T;
prefix(style: CSSStyleDeclaration): CSSStyleDeclaration;
export function createPrefixer(staticData: StaticData): Prefix;
// support for React.CSSProperties
prefix<T>(style: T): T;
static prefixAll(style: CSSStyleDeclaration): CSSStyleDeclaration;
// support for React.CSSProperties
static prefixAll<T>(style: T): T;
}
export = InlineStylePrefixer;
export const prefix: Prefix;

View File

@ -1,8 +1,6 @@
import Prefixer = require('inline-style-prefixer');
import { prefix } from 'inline-style-prefixer';
const prefixer = new Prefixer();
const prefixed = prefixer.prefix({
const prefixed = prefix({
fontSize: '16',
flexDirection: 'column'
});