Correct signature for readFileSync

This commit is contained in:
Barth, Christopher
2017-07-12 10:31:27 -04:00
parent 8a31f32b81
commit 0efb818c96
4 changed files with 4 additions and 4 deletions

View File

@@ -2834,7 +2834,7 @@ declare module "fs" {
* @param fileName
* @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer.
*/
export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string;
export function readFileSync(filename: string, options: { encoding?: string | null; flag?: string; }): string;
/**
* Synchronous readFile - Synchronously reads the entire contents of a file.
*

View File

@@ -1764,7 +1764,7 @@ declare module "fs" {
* @param fileName
* @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer.
*/
export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string;
export function readFileSync(filename: string, options: { encoding?: string | null; flag?: string; }): string;
/**
* Synchronous readFile - Synchronously reads the entire contents of a file.
*

View File

@@ -2553,7 +2553,7 @@ declare module "fs" {
* @param fileName
* @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer.
*/
export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string;
export function readFileSync(filename: string, options: { encoding?: string | null; flag?: string; }): string;
/**
* Synchronous readFile - Synchronously reads the entire contents of a file.
*

View File

@@ -2685,7 +2685,7 @@ declare module "fs" {
* @param fileName
* @param options An object with optional {encoding} and {flag} properties. If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer.
*/
export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string;
export function readFileSync(filename: string, options: { encoding?: string | null; flag?: string; }): string;
/**
* Synchronous readFile - Synchronously reads the entire contents of a file.
*