mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add typings for cssbeautify library (#11460)
* Add typings for cssbeautify library * Don't paper over the fact that cssbeautify isn't ES module compatible.
This commit is contained in:
parent
07ce2df4f2
commit
779e53eb3b
13
cssbeautify/cssbeautify-tests.ts
Normal file
13
cssbeautify/cssbeautify-tests.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import cssbeautify = require('./index');
|
||||
|
||||
var str = '';
|
||||
|
||||
str = cssbeautify(str);
|
||||
|
||||
str = cssbeautify(str, {});
|
||||
|
||||
str = cssbeautify(str, {
|
||||
indent: ' ',
|
||||
openbrace: 'separate-line',
|
||||
autosemicolon: true
|
||||
});
|
||||
25
cssbeautify/index.d.ts
vendored
Normal file
25
cssbeautify/index.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
// Type definitions for CSS Beautify v0.3.1
|
||||
// Project: https://github.com/senchalabs/cssbeautify
|
||||
// Definitions by: rictic <https://github.com/rictic>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* A string used for the indentation of the declaration (default is 4
|
||||
* spaces).
|
||||
*/
|
||||
indent?: string;
|
||||
/**
|
||||
* Defines the placement of open curly brace, either end-of-line (default)
|
||||
* or separate-line
|
||||
*/
|
||||
openbrace?: 'end-of-line'|'separate-line';
|
||||
|
||||
/**
|
||||
* Always inserts a semicolon after the last ruleset(default is false)
|
||||
*/
|
||||
autosemicolon?: boolean;
|
||||
}
|
||||
declare function beautify(cssText: string, options?: Options): string;
|
||||
|
||||
export = beautify;
|
||||
19
cssbeautify/tsconfig.json
Normal file
19
cssbeautify/tsconfig.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cssbeautify-tests.ts"
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user