summaryrefslogtreecommitdiff
path: root/cli/js/lib.deno.ns.d.ts
diff options
context:
space:
mode:
authordubiousjim <dubiousjim@gmail.com>2020-03-06 11:29:23 -0500
committerGitHub <noreply@github.com>2020-03-06 11:29:23 -0500
commitacf0958e940f8c668c9f34dc780da48d8963a1e7 (patch)
tree69816ce683e0b369e2c7b6566cc249255a39953d /cli/js/lib.deno.ns.d.ts
parentbb3d9c8280912f6e30692477aeb5331fb359d993 (diff)
Rename name/filename arguments to path (#4227)
There's a lot of variation in doc comments and internal code about whether the first parameter to file system calls is `path` or `name` or `filename`. For consistency, have made it always be `path`.
Diffstat (limited to 'cli/js/lib.deno.ns.d.ts')
-rw-r--r--cli/js/lib.deno.ns.d.ts56
1 files changed, 28 insertions, 28 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts
index c6318b8ab..2acf62874 100644
--- a/cli/js/lib.deno.ns.d.ts
+++ b/cli/js/lib.deno.ns.d.ts
@@ -435,7 +435,7 @@ declare namespace Deno {
*
* Requires `allow-read` and `allow-write` permissions depending on mode.
*/
- export function openSync(filename: string, options?: OpenOptions): File;
+ export function openSync(path: string, options?: OpenOptions): File;
/** Synchronously open a file and return an instance of the `File` object.
*
@@ -443,7 +443,7 @@ declare namespace Deno {
*
* Requires `allow-read` and `allow-write` permissions depending on mode.
*/
- export function openSync(filename: string, mode?: OpenMode): File;
+ export function openSync(path: string, mode?: OpenMode): File;
/** Open a file and resolve to an instance of the `File` object.
*
@@ -451,7 +451,7 @@ declare namespace Deno {
*
* Requires `allow-read` and `allow-write` permissions depending on mode.
*/
- export function open(filename: string, options?: OpenOptions): Promise<File>;
+ export function open(path: string, options?: OpenOptions): Promise<File>;
/** Open a file and resolves to an instance of `Deno.File`.
*
@@ -459,7 +459,7 @@ declare namespace Deno {
*
* Requires `allow-read` and `allow-write` permissions depending on mode.
*/
- export function open(filename: string, mode?: OpenMode): Promise<File>;
+ export function open(path: string, mode?: OpenMode): Promise<File>;
/** Creates a file if none exists or truncates an existing file and returns
* an instance of `Deno.File`.
@@ -468,7 +468,7 @@ declare namespace Deno {
*
* Requires `allow-read` and `allow-write` permissions.
*/
- export function createSync(filename: string): File;
+ export function createSync(path: string): File;
/** Creates a file if none exists or truncates an existing file and resolves to
* an instance of `Deno.File`.
@@ -477,7 +477,7 @@ declare namespace Deno {
*
* Requires `allow-read` and `allow-write` permissions.
*/
- export function create(filename: string): Promise<File>;
+ export function create(path: string): Promise<File>;
/** Synchronously read from a file ID into an array buffer.
*
@@ -893,14 +893,14 @@ declare namespace Deno {
/** **UNSTABLE**: needs investigation into high precision time.
*
* Synchronously changes the access and modification times of a file system
- * object referenced by `filename`. Given times are either in seconds (UNIX
- * epoch time) or as `Date` objects.
+ * object referenced by `path`. Given times are either in seconds (UNIX epoch
+ * time) or as `Date` objects.
*
* Deno.utimeSync("myfile.txt", 1556495550, new Date());
*
* Requires `allow-write` permission. */
export function utimeSync(
- filename: string,
+ path: string,
atime: number | Date,
mtime: number | Date
): void;
@@ -908,14 +908,14 @@ declare namespace Deno {
/** **UNSTABLE**: needs investigation into high precision time.
*
* Changes the access and modification times of a file system object
- * referenced by `filename`. Given times are either in seconds (UNIX epoch
- * time) or as `Date` objects.
+ * referenced by `path`. Given times are either in seconds (UNIX epoch time)
+ * or as `Date` objects.
*
* await Deno.utime("myfile.txt", 1556495550, new Date());
*
* Requires `allow-write` permission. */
export function utime(
- filename: string,
+ path: string,
atime: number | Date,
mtime: number | Date
): Promise<void>;
@@ -976,7 +976,7 @@ declare namespace Deno {
* console.log(decoder.decode(data));
*
* Requires `allow-read` permission. */
- export function readFileSync(filename: string): Uint8Array;
+ export function readFileSync(path: string): Uint8Array;
/** Reads and resolves to the entire contents of a file.
*
@@ -985,7 +985,7 @@ declare namespace Deno {
* console.log(decoder.decode(data));
*
* Requires `allow-read` permission. */
- export function readFile(filename: string): Promise<Uint8Array>;
+ export function readFile(path: string): Promise<Uint8Array>;
// @url js/file_info.d.ts
@@ -1127,52 +1127,52 @@ declare namespace Deno {
* const targetPath = Deno.readlinkSync("symlink/path");
*
* Requires `allow-read` permission. */
- export function readlinkSync(name: string): string;
+ export function readlinkSync(path: string): string;
/** Resolves to the destination of the named symbolic link.
*
* const targetPath = await Deno.readlink("symlink/path");
*
* Requires `allow-read` permission. */
- export function readlink(name: string): Promise<string>;
+ export function readlink(path: string): Promise<string>;
// @url js/stat.d.ts
- /** Resolves to a `Deno.FileInfo` for the specified path. If path is a
+ /** Resolves to a `Deno.FileInfo` for the specified `path`. If `path` is a
* symlink, information for the symlink will be returned.
*
* const fileInfo = await Deno.lstat("hello.txt");
* assert(fileInfo.isFile());
*
* Requires `allow-read` permission. */
- export function lstat(filename: string): Promise<FileInfo>;
+ export function lstat(path: string): Promise<FileInfo>;
- /** Synchronously returns a `Deno.FileInfo` for the specified path. If
- * path is a symlink, information for the symlink will be returned.
+ /** Synchronously returns a `Deno.FileInfo` for the specified `path`. If
+ * `path` is a symlink, information for the symlink will be returned.
*
* const fileInfo = Deno.lstatSync("hello.txt");
* assert(fileInfo.isFile());
*
* Requires `allow-read` permission. */
- export function lstatSync(filename: string): FileInfo;
+ export function lstatSync(path: string): FileInfo;
- /** Resolves to a `Deno.FileInfo` for the specified path. Will always follow
- * symlinks.
+ /** Resolves to a `Deno.FileInfo` for the specified `path`. Will always
+ * follow symlinks.
*
* const fileInfo = await Deno.stat("hello.txt");
* assert(fileInfo.isFile());
*
* Requires `allow-read` permission. */
- export function stat(filename: string): Promise<FileInfo>;
+ export function stat(path: string): Promise<FileInfo>;
- /** Synchronously returns a `Deno.FileInfo` for the specified path. Will
+ /** Synchronously returns a `Deno.FileInfo` for the specified `path`. Will
* always follow symlinks.
*
* const fileInfo = Deno.statSync("hello.txt");
* assert(fileInfo.isFile());
*
* Requires `allow-read` permission. */
- export function statSync(filename: string): FileInfo;
+ export function statSync(path: string): FileInfo;
// @url js/link.d.ts
@@ -1246,7 +1246,7 @@ declare namespace Deno {
* Requires `allow-write` permission, and `allow-read` if create is `false`.
*/
export function writeFileSync(
- filename: string,
+ path: string,
data: Uint8Array,
options?: WriteFileOptions
): void;
@@ -1261,7 +1261,7 @@ declare namespace Deno {
* Requires `allow-write` permission, and `allow-read` if create is `false`.
*/
export function writeFile(
- filename: string,
+ path: string,
data: Uint8Array,
options?: WriteFileOptions
): Promise<void>;