mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Type definitions and tests for node luaparse module
This commit is contained in:
10
luaparse/luaparse-tests.ts
Normal file
10
luaparse/luaparse-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/// <reference path="luaparse.d.ts" />
|
||||
|
||||
import luaparse = require('luaparse');
|
||||
|
||||
var luacode: string = '-- this is hello world in lua.\nprint(\'hello world\')';
|
||||
var ast: Object = luaparse.parse(luacode);
|
||||
console.log(JSON.stringify(ast));
|
||||
|
||||
ast = luaparse.parse(luacode, {comments: false});
|
||||
console.log(JSON.stringify(ast));
|
||||
8
luaparse/luaparse.d.ts
vendored
Normal file
8
luaparse/luaparse.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// Type definitions for luaparse
|
||||
// Project: https://github.com/oxyc/luaparse
|
||||
// Definitions by: Sam Saint-Pettersen <https://github.com/stpettersens>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "luaparse" {
|
||||
export function parse(code: string, options?: Object): Object;
|
||||
}
|
||||
Reference in New Issue
Block a user