mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 11:02:11 +08:00
Add coffeeify
This commit is contained in:
15
coffeeify/coffeeify-tests.ts
Normal file
15
coffeeify/coffeeify-tests.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/// <reference path="coffeeify.d.ts" />
|
||||
|
||||
import coffeeify = require('coffeeify');
|
||||
|
||||
coffeeify.sourceMap = false;
|
||||
|
||||
var isCoffee = coffeeify.isCoffee('foo.coffee');
|
||||
var isLiterate = coffeeify.isLiterate('bar.coffee');
|
||||
coffeeify.compile('out.js', 'console.log 42', (err, compiled) => {
|
||||
console.log(err);
|
||||
console.log(compiled);
|
||||
});
|
||||
|
||||
coffeeify('test.coffee').end();
|
||||
|
||||
37
coffeeify/coffeeify.d.ts
vendored
Normal file
37
coffeeify/coffeeify.d.ts
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
// Type definitions for coffeeify
|
||||
// Project: https://github.com/jnordberg/coffeeify
|
||||
// Definitions by: Qubo <https://github.com/tkQubo>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../through/through.d.ts" />
|
||||
|
||||
declare module "coffeeify" {
|
||||
import through = require('through');
|
||||
|
||||
namespace coffeeify {
|
||||
interface Coffeeify {
|
||||
isCoffee(file: string): boolean;
|
||||
isLiterate(file: string): boolean;
|
||||
sourceMap: boolean;
|
||||
compile(file: string, data: string, callback: Callback): void;
|
||||
(file: string): through.ThroughStream;
|
||||
}
|
||||
|
||||
interface Callback {
|
||||
(error: ParseError, compiled: string): void;
|
||||
}
|
||||
|
||||
interface ParseError extends SyntaxError {
|
||||
new(error: any, src: string, file: string): ParseError;
|
||||
message: string;
|
||||
line: number;
|
||||
column: number;
|
||||
annotated: string;
|
||||
}
|
||||
}
|
||||
|
||||
var coffeeify: coffeeify.Coffeeify;
|
||||
|
||||
export = coffeeify;
|
||||
}
|
||||
|
||||
4
through/through.d.ts
vendored
4
through/through.d.ts
vendored
@@ -8,7 +8,7 @@
|
||||
declare module "through" {
|
||||
import stream = require("stream");
|
||||
|
||||
function through(write?: (data) => void,
|
||||
function through(write?: (data: any) => void,
|
||||
end?: () => void,
|
||||
opts?: {
|
||||
autoDestroy: boolean;
|
||||
@@ -21,4 +21,4 @@ declare module "through" {
|
||||
}
|
||||
|
||||
export = through;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user