Comments (9)
typings/main/ambient/node/index.d.ts(329,22): error TS2304: Cannot find name 'Intl'.
typings/main/ambient/node/index.d.ts(355,25): error TS2304: Cannot find name 'console'.
from env-node.
I'm curious, but if console
is a variable that might be declared in lib.d.ts
wouldn't redeclaring it in node.d.ts
cause duplicate declaration error and break for all users not using lib.core.d.ts
?
from env-node.
@louy It shouldn't if the signatures are compatible, but we can check.
from env-node.
I've just tried adding message
attribute to Error
interface and it gave me an error. (I wanted to add a jsdoc comment)
node_modules/typescript/lib/lib.d.ts(880,5): error TS2300: Duplicate identifier 'message'.
4/node.d.ts(22,3): error TS2300: Duplicate identifier 'message'.
So I guess this won't work.
from env-node.
Hmm, I'll give it a shot too. Let me try, because they are technically different on node and browsers so it'd be good to type it correctly (and make it work if users are using the default browser typings).
from env-node.
I think it would be nice if we have a separate version with noLib
support. Let me know once you've tried that.
from env-node.
@louy Sorry for the delay, I just confirmed it works perfectly fine (interfaces merge properly). The only issue I haven't resolved is new console.Console(process.stdout)
that node allows.
from env-node.
@louy Actually, got it, easy. Just do:
declare interface Console {
log (msg: any, ...params: any[]): void;
info (msg: any, ...params: any[]): void;
warn (msg: any, ...params: any[]): void;
error (msg: any, ...params: any[]): void;
dir (value: any, ...params: any[]): void;
time (timerName?: string): void;
timeEnd (timerName?: string): void;
trace (msg: any, ...params: any[]): void;
assert (test?: boolean, msg?: string, ...params: any[]): void;
Console: new (stdout: any /* Change this to write-able stream */) => Console;
}
declare var console: Console;
from env-node.
Really? can you put it in a branch?
from env-node.
Related Issues (20)
- process.stdout should be WritableStream | tty.WriteStream HOT 23
- Object.assign is missing in node 4/5/6 typings HOT 6
- Provide interface PipeOptions instead of { end?: boolean }
- (Re)export ReadWriteStream interface in 'stream' external module HOT 1
- Expose types from `ts-node`
- "connected" property missing from ChildProcess in Node 4.x and below HOT 1
- Error.stackTraceLimit is number in node6? HOT 1
- "exitCode" property missing on NodeJS.process
- Kill `http.ServerRequest` type
- extend type define of NodeJS.Process.env HOT 12
- util.inspect() does not accept {depth: null} with strictNullChecks
- declare `fs.Stats` as a class
- url.format() does not accept string
- What happened to TlsOptions? HOT 1
- readFileSync `options` can be null HOT 2
- Old definitions in registry HOT 2
- Broken with newest es6.lib.d.ts HOT 3
- Add secureOptions to https.createServer options
- 7.0.8 Breaks when used with @types/Core-js HOT 3
- Wrong vm.createContext signature HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from env-node.