-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from Rich-Harris/declarations
Start adding declarations
- Loading branch information
Showing
2 changed files
with
94 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
interface WriteOptions { | ||
replacer?: ((key: string, value: any) => any) | (string | number)[]; | ||
indent?: number; | ||
writeMethod?: 'safeDump' | 'dump'; | ||
columns?: string[]; | ||
callback?: (err: Error, dataString: string) => void; | ||
} | ||
|
||
type Formatter = (file: string, options: WriteOptions) => string; | ||
|
||
interface ParserOptions { | ||
// TODO | ||
} | ||
|
||
type Parser = (str: string, options: ParserOptions) => any; | ||
|
||
// converters | ||
export function convertDbfToData( | ||
inFileName: string, | ||
outFileName: string, | ||
callback: (err: Error) => void | ||
): void; | ||
|
||
export function convertDbfToData( | ||
inFileName: string, | ||
outFileName: string, | ||
options: { makeDirectories: boolean }, | ||
callback: (err: Error) => void | ||
): void; | ||
|
||
// helpers | ||
export function deepExtend<T>( | ||
destination: T, | ||
...sources: object[] | ||
): T; | ||
|
||
export function discernFileFormatter( | ||
fileName: string | ||
): Formatter; | ||
|
||
export function discernFormat( | ||
fileName: string | ||
): string; | ||
|
||
export function discernParser( | ||
fileName: string, | ||
delimiter?: string | ||
): Parser; | ||
|
||
export function exists( | ||
fileName: string, | ||
callback: (err: Error, exists: boolean) => void | ||
): void; | ||
|
||
export function existsSync( | ||
fileName: string | ||
): boolean; | ||
|
||
export function extend<T>( | ||
deep: boolean, | ||
destination: T, | ||
...sources: T[] | ||
): T; | ||
|
||
export function extend<T>( | ||
destination: T, | ||
...sources: T[] | ||
): T; | ||
|
||
export function extMatchesStr( | ||
fileName: string, | ||
extension: string | ||
): boolean; | ||
|
||
export function makeDirectories( | ||
outPath: string, | ||
callback: (err: Error) => null | ||
): void; | ||
|
||
export function makeDirectoriesSync( | ||
outPath: string | ||
): void; | ||
|
||
export function matches( | ||
fileName: string, | ||
matcher: string | RegExp | ||
): boolean; | ||
|
||
export function matchesRegExp( | ||
fileName: string, | ||
regex: RegExp | ||
): boolean; | ||
|
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