mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
21 lines
463 B
TypeScript
21 lines
463 B
TypeScript
//// [tests/cases/compiler/ambientRequireFunction.ts] ////
|
|
|
|
//// [node.d.ts]
|
|
declare function require(moduleName: string): any;
|
|
|
|
declare module "fs" {
|
|
export function readFileSync(s: string): string;
|
|
}
|
|
|
|
//// [app.js]
|
|
/// <reference path="node.d.ts"/>
|
|
|
|
const fs = require("fs");
|
|
const text = fs.readFileSync("/a/b/c");
|
|
|
|
//// [app.js]
|
|
"use strict";
|
|
/// <reference path="node.d.ts"/>
|
|
const fs = require("fs");
|
|
const text = fs.readFileSync("/a/b/c");
|