ts-book icon indicating copy to clipboard operation
ts-book copied to clipboard

[p.392, 오타] readFile 함수인터페이스 1번째 파라미터 누락

Open wiseguy77 opened this issue 1 year ago • 0 comments

readFile 함수인터페이스 1번째 파라미터 'path'가 모든 오버로딩 함수에서 누락

[환경] @types/[email protected]의 promises.d.ts 파일의 해당 부분 코드는 다음과 같습니다.

function readFile(
        path: PathLike | FileHandle,
        options?:
            | ({
                  encoding?: null | undefined;
                  flag?: OpenMode | undefined;
              } & Abortable)
            | null
    ): Promise<Buffer>;
    
    function readFile(
        path: PathLike | FileHandle,
        options:
            | ({
                  encoding: BufferEncoding;
                  flag?: OpenMode | undefined;
              } & Abortable)
            | BufferEncoding
    ): Promise<string>;
    
    function readFile(
        path: PathLike | FileHandle,
        options?:
            | (ObjectEncodingOptions &
                  Abortable & {
                      flag?: OpenMode | undefined;
                  })
            | BufferEncoding
            | null
    ): Promise<string | Buffer>;

wiseguy77 avatar Sep 07 '23 11:09 wiseguy77