mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-04 19:42:46 +08:00
Add linting to webpack-sources.
This commit is contained in:
17
types/webpack-sources/index.d.ts
vendored
17
types/webpack-sources/index.d.ts
vendored
@@ -1,15 +1,14 @@
|
||||
// Type definitions for webpack-sources v0.1.2
|
||||
// Type definitions for webpack-sources 0.1
|
||||
// Project: https://github.com/webpack/webpack-sources
|
||||
// Definitions by: e-cloud <http://github.com/e-cloud>
|
||||
// Chris Eppstein <http://github.com/chriseppstein>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="source-map" />
|
||||
/// <reference types="source-list-map" />
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Hash } from 'crypto'
|
||||
import { SourceNode, RawSourceMap, SourceMapGenerator } from 'source-map'
|
||||
import { SourceListMap } from 'source-list-map'
|
||||
import { Hash } from 'crypto';
|
||||
import { SourceNode, RawSourceMap, SourceMapGenerator } from 'source-map';
|
||||
import { SourceListMap } from 'source-list-map';
|
||||
|
||||
export abstract class Source {
|
||||
size(): number;
|
||||
@@ -32,7 +31,7 @@ export abstract class Source {
|
||||
listMap(options?: any): any;
|
||||
}
|
||||
|
||||
interface SourceAndMapMixin {
|
||||
export interface SourceAndMapMixin {
|
||||
map(options: { columns?: boolean }): RawSourceMap;
|
||||
sourceAndMap(options: { columns?: boolean }): {
|
||||
source: string;
|
||||
@@ -67,9 +66,9 @@ export class CachedSource {
|
||||
}
|
||||
|
||||
export class ConcatSource extends Source implements SourceAndMapMixin {
|
||||
children: (string | Source)[];
|
||||
children: Array<(string | Source)>;
|
||||
|
||||
constructor(...args: (string | Source)[]);
|
||||
constructor(...args: Array<(string | Source)>);
|
||||
|
||||
add(item: string | Source): void;
|
||||
|
||||
|
||||
1
types/webpack-sources/tslint.json
Normal file
1
types/webpack-sources/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -7,9 +7,8 @@ import {
|
||||
ReplaceSource,
|
||||
OriginalSource,
|
||||
SourceMapSource,
|
||||
|
||||
} from 'webpack-sources';
|
||||
import { RawSourceMap } from 'source-map'
|
||||
import { RawSourceMap } from 'source-map';
|
||||
|
||||
const s1 = new OriginalSource('a', 'b');
|
||||
|
||||
@@ -19,8 +18,8 @@ const s3 = new ConcatSource('a', 'b', s1);
|
||||
|
||||
const s4 = new RawSource('hey');
|
||||
|
||||
const a = {} as RawSourceMap
|
||||
const b = {} as RawSourceMap
|
||||
const a = {} as RawSourceMap;
|
||||
const b = {} as RawSourceMap;
|
||||
|
||||
const s5 = new LineToLineMappedSource('a', 'v', 'c');
|
||||
const s6 = new PrefixSource(s4, s5);
|
||||
|
||||
Reference in New Issue
Block a user