mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
stream-csv-as-json: split modules, followed lint suggestions.
This commit is contained in:
parent
583db23c98
commit
acc527ca1b
38
types/stream-csv-as-json/AsObjects.d.ts
vendored
Normal file
38
types/stream-csv-as-json/AsObjects.d.ts
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import { TransformOptions, Transform } from 'stream';
|
||||
import * as Chain from 'stream-chain';
|
||||
|
||||
export = AsObjects;
|
||||
|
||||
declare class AsObjects extends Transform {
|
||||
constructor(options?: AsObjects.AsObjectOptions);
|
||||
}
|
||||
|
||||
declare namespace AsObjects {
|
||||
interface AsObjectOptions extends TransformOptions {
|
||||
packValues?: boolean;
|
||||
packStrings?: boolean;
|
||||
streamValues?: boolean;
|
||||
streamStrings?: boolean;
|
||||
useValues?: boolean;
|
||||
useStringValues?: boolean;
|
||||
fieldPrefix?: string;
|
||||
}
|
||||
|
||||
function make(options?: AsObjectOptions): AsObjects;
|
||||
|
||||
namespace make {
|
||||
type Constructor = AsObjects;
|
||||
const Constructor: typeof AsObjects;
|
||||
}
|
||||
|
||||
function asObjects(options?: AsObjectOptions): AsObjects;
|
||||
|
||||
namespace asObjects {
|
||||
type Constructor = AsObjects;
|
||||
const Constructor: typeof AsObjects;
|
||||
}
|
||||
|
||||
function withParser(options?: AsObjectOptions): Chain;
|
||||
}
|
||||
33
types/stream-csv-as-json/Parser.d.ts
vendored
Normal file
33
types/stream-csv-as-json/Parser.d.ts
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Transform, TransformOptions } from 'stream';
|
||||
|
||||
export = Parser;
|
||||
|
||||
declare class Parser extends Transform {
|
||||
constructor(options?: Parser.ParserOptions);
|
||||
}
|
||||
|
||||
declare namespace Parser {
|
||||
interface ParserOptions extends TransformOptions {
|
||||
packValues?: boolean;
|
||||
packStrings?: boolean;
|
||||
streamValues?: boolean;
|
||||
streamStrings?: boolean;
|
||||
separator?: string;
|
||||
}
|
||||
|
||||
function make(options?: ParserOptions): Parser;
|
||||
|
||||
namespace make {
|
||||
type Constructor = Parser;
|
||||
const Constructor: typeof Parser;
|
||||
}
|
||||
|
||||
function parser(options?: ParserOptions): Parser;
|
||||
|
||||
namespace parser {
|
||||
type Constructor = Parser;
|
||||
const Constructor: typeof Parser;
|
||||
}
|
||||
}
|
||||
31
types/stream-csv-as-json/Stringer.d.ts
vendored
Normal file
31
types/stream-csv-as-json/Stringer.d.ts
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Transform, TransformOptions } from 'stream';
|
||||
|
||||
export = Stringer;
|
||||
|
||||
declare class Stringer extends Transform {
|
||||
constructor(options?: Stringer.StringerOptions);
|
||||
}
|
||||
|
||||
declare namespace Stringer {
|
||||
interface StringerOptions extends TransformOptions {
|
||||
useValues?: boolean;
|
||||
useStringValues?: boolean;
|
||||
separator?: string;
|
||||
}
|
||||
|
||||
function make(options?: StringerOptions): Stringer;
|
||||
|
||||
namespace make {
|
||||
type Constructor = Stringer;
|
||||
const Constructor: typeof Stringer;
|
||||
}
|
||||
|
||||
function stringer(options?: StringerOptions): Stringer;
|
||||
|
||||
namespace stringer {
|
||||
type Constructor = Stringer;
|
||||
const Constructor: typeof Stringer;
|
||||
}
|
||||
}
|
||||
129
types/stream-csv-as-json/index.d.ts
vendored
129
types/stream-csv-as-json/index.d.ts
vendored
@ -3,126 +3,19 @@
|
||||
// Definitions by: Eugene Lazutkin <https://github.com/uhop>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
import * as AsObjects from './AsObjects';
|
||||
import * as Parser from './Parser';
|
||||
import * as Stringer from './Stringer';
|
||||
|
||||
declare module 'stream-csv-as-json' {
|
||||
import * as Parser from 'stream-csv-as-json/Parser';
|
||||
export = make;
|
||||
|
||||
export = make;
|
||||
declare function make(options?: Parser.ParserOptions): Parser;
|
||||
|
||||
function make(options?: Parser.ParserOptions): Parser;
|
||||
type ParserClass = Parser;
|
||||
type ParserType = typeof Parser;
|
||||
|
||||
type ParserClass = Parser;
|
||||
type ParserType = typeof Parser;
|
||||
|
||||
namespace make {
|
||||
type Parser = ParserClass;
|
||||
const Parser: ParserType;
|
||||
const parser: (options?: Parser.ParserOptions) => Parser;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'stream-csv-as-json/AsObjects' {
|
||||
import { TransformOptions, Transform } from 'stream';
|
||||
import * as Chain from 'stream-chain';
|
||||
|
||||
export = AsObjects;
|
||||
|
||||
class AsObjects extends Transform {
|
||||
constructor(options?: AsObjects.AsObjectOptions);
|
||||
}
|
||||
|
||||
namespace AsObjects {
|
||||
interface AsObjectOptions extends TransformOptions {
|
||||
packValues?: boolean;
|
||||
packStrings?: boolean;
|
||||
streamValues?: boolean;
|
||||
streamStrings?: boolean;
|
||||
useValues?: boolean;
|
||||
useStringValues?: boolean;
|
||||
fieldPrefix?: string;
|
||||
}
|
||||
|
||||
function make(options?: AsObjects.AsObjectOptions): AsObjects;
|
||||
|
||||
namespace make {
|
||||
type Constructor = AsObjects;
|
||||
const Constructor: typeof AsObjects;
|
||||
}
|
||||
|
||||
function asObjects(options?: AsObjects.AsObjectOptions): AsObjects;
|
||||
|
||||
namespace asObjects {
|
||||
type Constructor = AsObjects;
|
||||
const Constructor: typeof AsObjects;
|
||||
}
|
||||
|
||||
function withParser(options?: AsObjects.AsObjectOptions): Chain;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'stream-csv-as-json/Parser' {
|
||||
import { Transform, TransformOptions } from 'stream';
|
||||
|
||||
export = Parser;
|
||||
|
||||
class Parser extends Transform {
|
||||
constructor(options?: Parser.ParserOptions);
|
||||
}
|
||||
|
||||
namespace Parser {
|
||||
interface ParserOptions extends TransformOptions {
|
||||
packValues?: boolean;
|
||||
packStrings?: boolean;
|
||||
streamValues?: boolean;
|
||||
streamStrings?: boolean;
|
||||
separator?: string;
|
||||
}
|
||||
|
||||
function make(options?: ParserOptions): Parser;
|
||||
|
||||
namespace make {
|
||||
type Constructor = Parser;
|
||||
const Constructor: typeof Parser;
|
||||
}
|
||||
|
||||
function parser(options?: ParserOptions): Parser;
|
||||
|
||||
namespace parser {
|
||||
type Constructor = Parser;
|
||||
const Constructor: typeof Parser;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'stream-csv-as-json/Stringer' {
|
||||
import { Transform, TransformOptions } from 'stream';
|
||||
|
||||
export = Stringer;
|
||||
|
||||
class Stringer extends Transform {
|
||||
constructor(options?: Stringer.StringerOptions);
|
||||
}
|
||||
|
||||
namespace Stringer {
|
||||
interface StringerOptions extends TransformOptions {
|
||||
useValues?: boolean;
|
||||
useStringValues?: boolean;
|
||||
separator?: string;
|
||||
}
|
||||
|
||||
function make(options?: StringerOptions): Stringer;
|
||||
|
||||
namespace make {
|
||||
type Constructor = Stringer;
|
||||
const Constructor: typeof Stringer;
|
||||
}
|
||||
|
||||
function stringer(options?: StringerOptions): Stringer;
|
||||
|
||||
namespace stringer {
|
||||
type Constructor = Stringer;
|
||||
const Constructor: typeof Stringer;
|
||||
}
|
||||
}
|
||||
declare namespace make {
|
||||
type Parser = ParserClass;
|
||||
const Parser: ParserType;
|
||||
function parser(options?: Parser.ParserOptions): Parser;
|
||||
}
|
||||
|
||||
@ -9,7 +9,8 @@
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": ["index.d.ts", "stream-csv-as-json-tests.ts"]
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user