webdav-client
webdav-client copied to clipboard
feat: add ts overload to getFileContents
so that we get explicit return type when different options provided
getFileContents({} as any, "/").then(res => res.byteLength); // res: BufferLike
getFileContents({} as any, "/", { format: "text" }).then(res => res.length); // res: string
getFileContents({} as any, "/", { details: true }).then(res => res.data.byteLength); // res: Detail<BufferLike>
getFileContents({} as any, "/", { details: true, format: "text" }).then(res => res.data.length); // res: Detail<string>