definitions for karma-fixture (#10724)

* definitions for karma-fixture

* return type here can be any object with any keys (arbitrary JSON)

* Update karma-fixture.d.ts
This commit is contained in:
Ezekiel Victor
2016-08-20 18:55:51 +09:00
committed by Masahiro Wakame
parent 88c5e9aca6
commit 502f0dfb79
2 changed files with 37 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
/// <reference path="karma-fixture.d.ts" />
fixture.setBase('fixtures/base/path');
fixture.load('test1.html', 'test1.json', false);
fixture.load('test1.html', 'test2.html', 'test1.json');
fixture.set('<em></em>', true);
fixture.set('<em></em>', '<strong><strong/>');
fixture.cleanup();
fixture.el.firstChild;
JSON.stringify(fixture.json[0]);
+27
View File
@@ -0,0 +1,27 @@
// Type definitions for karma-fixture 0.2.6
// Project: https://github.com/billtrik/karma-fixture
// Definitions by: Ezekiel Victor <https://github.com/evictor/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module fixture {
var el: HTMLElement;
var json: any[];
function load(...files: string[]): any;
function load(file1: string, append?: boolean): any;
function load(file1: string, file2: string, append?: boolean): any;
function load(file1: string, file2: string, file3: string, append?: boolean): any;
function load(file1: string, file2: string, file3: string, file4: string, append?: boolean): any;
function load(file1: string, file2: string, file3: string, file4: string, file5: string, append?: boolean): any;
function set(...htmlStrs: string[]): HTMLElement|HTMLElement[];
function set(htmlStr1: string, append?: boolean): HTMLElement|HTMLElement[];
function set(htmlStr1: string, htmlStr2: string, append?: boolean): HTMLElement|HTMLElement[];
function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, append?: boolean): HTMLElement|HTMLElement[];
function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, htmlStr4: string, append?: boolean): HTMLElement|HTMLElement[];
function set(htmlStr1: string, htmlStr2: string, htmlStr3: string, htmlStr4: string, htmlStr5: string, append?: boolean): HTMLElement|HTMLElement[];
function cleanup(): void;
function setBase(fixtureBasePath: string): void;
}