Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f911146
commit 7e9c2a3
Showing
6 changed files
with
293 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,39 @@ | ||
|
||
interface ParseOptions { | ||
export interface ParseOptions { | ||
/** | ||
* @defaultValue [' ', '/t'] | ||
*/ | ||
splitChars?: string[] | ||
} | ||
interface ReadTable { | ||
parse(output: string, options?: ParseOptions): { | ||
fistLine: string[], | ||
lines: string[][] | ||
} | ||
parseObject(output: string, options?: ParseOptions) : { | ||
fistLine: string[], | ||
records: Map<string, string>[] | ||
} | ||
export interface FieldName { | ||
begin: number | ||
end: number | ||
name: string | ||
len: number | ||
} | ||
export interface Line { | ||
[fieldName: string]: string | ||
} | ||
export interface RawLines { | ||
fistLine: string[], | ||
lines: string[][] | ||
} | ||
export interface ObjectLines { | ||
fistLine: string[], | ||
records: Map<string, string>[] | ||
} | ||
export interface Head { | ||
fieldNames: FieldName[] | ||
firstLenEnd: number | ||
} | ||
export interface FixedLines { | ||
lines: Line[] | ||
fieldNames: FieldName[] | ||
} | ||
export interface ReadTable { | ||
parseRaw(output: string, options?: ParseOptions): RawLines | ||
parseRaw2Object(output: string, options?: ParseOptions) : ObjectLines | ||
parseFixed(output: string): FixedLines | ||
} | ||
declare const readTable: ReadTable | ||
export default readTable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.