mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
remove node from tsconfig types and use import statement in tests
This commit is contained in:
Vendored
+4
-5
@@ -1,14 +1,13 @@
|
||||
// Type definitions for jotform-css.js v1.0.1
|
||||
// Project: https://github.com/jotform/css.js
|
||||
// Definitions by: My Self <https://github.com/pandawood>
|
||||
// Definitions by: Peter van der Woude <https://github.com/pandawood>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
/// <reference types="node" />
|
||||
|
||||
/**
|
||||
* intermediate object - needed as a result of the way the libary doesn't explicitly export anything
|
||||
* Thid doesn't get used in the way I intended
|
||||
*/
|
||||
export interface CssJsGlobal {
|
||||
cssjs() : CssJs
|
||||
}
|
||||
export function cssjs() : CssJs
|
||||
|
||||
export interface CssJs {
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
let cssjsGlobal = require("../../jotform-css.js")
|
||||
import cssjsGlobal = require("../jotform-css.js")
|
||||
import { CssJs } from "./index"
|
||||
|
||||
// not all interface methods tested here, below is a sample of code that I've actually used
|
||||
class TestParser {
|
||||
public parse(): string {
|
||||
const parser = new cssjsGlobal.cssjs() as CssJs
|
||||
public parse(cssString: string): string {
|
||||
const parser = new (<any>cssjsGlobal).cssjs() as CssJs
|
||||
|
||||
let parsed = parser.parseCSS(".foo { background-color: red }")
|
||||
let parsed = parser.parseCSS(cssString)
|
||||
parsed = parser.applyNamespacing(parsed, "#id1")
|
||||
let css = parser.getCSSForEditor(parsed)
|
||||
return css
|
||||
@@ -14,4 +14,4 @@ class TestParser {
|
||||
}
|
||||
|
||||
let parsingTest = new TestParser()
|
||||
let css = parsingTest.parse()
|
||||
let css = parsingTest.parse(".foo { background-color: red }")
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": ["node"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user