mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-29 17:08:21 +08:00
bunyan: fix ts1202 errors when targeting es6
Before this change:
```
[ray@localhost DefinitelyTyped]$ tsc --noImplicitAny bunyan/bunyan-test.ts --module commonjs --target es6
bunyan/bunyan-test.ts(3,1): error TS1202: Import assignment cannot be
used when targeting ECMAScript 6 or higher. Consider using 'import * as
ns from "mod"', 'import {a} from "mod"' or 'import d from "mod"'
instead.
bunyan/bunyan.d.ts(9,5): error TS1202: Import assignment cannot be used
when targeting ECMAScript 6 or higher. Consider using 'import * as ns
from "mod"', 'import {a} from "mod"' or 'import d from "mod"' instead.
[ray@localhost DefinitelyTyped]$
```
After this change:
```
[ray@localhost DefinitelyTyped]$ tsc --noImplicitAny bunyan/bunyan-test.ts --module commonjs --target es6
[ray@localhost DefinitelyTyped]$
```
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/// <reference path="bunyan.d.ts" />
|
||||
|
||||
import bunyan = require('bunyan');
|
||||
import * as bunyan from 'bunyan';
|
||||
|
||||
var ringBufferOptions:bunyan.RingBufferOptions = {
|
||||
limit: 100
|
||||
|
||||
8
bunyan/bunyan.d.ts
vendored
8
bunyan/bunyan.d.ts
vendored
@@ -6,9 +6,7 @@
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "bunyan" {
|
||||
import events = require('events');
|
||||
import EventEmitter = events.EventEmitter;
|
||||
import WritableStream = NodeJS.WritableStream;
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
class Logger extends EventEmitter {
|
||||
constructor(options:LoggerOptions);
|
||||
@@ -52,7 +50,7 @@ declare module "bunyan" {
|
||||
name: string;
|
||||
streams?: Stream[];
|
||||
level?: string | number;
|
||||
stream?: WritableStream;
|
||||
stream?: NodeJS.WritableStream;
|
||||
serializers?: Serializers;
|
||||
src?: boolean;
|
||||
}
|
||||
@@ -65,7 +63,7 @@ declare module "bunyan" {
|
||||
type?: string;
|
||||
level?: number | string;
|
||||
path?: string;
|
||||
stream?: WritableStream | Stream;
|
||||
stream?: NodeJS.WritableStream | Stream;
|
||||
closeOnExit?: boolean;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user