Skip to content

Commit

Permalink
Improve API docs for Deno.bundle and Deno.chdir (denoland#4426)
Browse files Browse the repository at this point in the history
  • Loading branch information
cknight committed Mar 18, 2020
1 parent 6e2df8c commit 2a34cbf
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions cli/js/lib.deno.ns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,18 @@ declare namespace Deno {
export function cwd(): string;

/**
* **UNSTABLE**: maybe needs permissions.
* **UNSTABLE**: Currently under evaluation to decide if explicit permission is
* required to change the current working directory.
*
* Change the current working directory to the specified path.
*
* Throws `Deno.errors.NotFound` if directory not available.
* Deno.chdir("/home/userA");
* Deno.chdir("../userB");
* Deno.chdir("C:\\Program Files (x86)\\Java");
*
* Throws `Deno.errors.NotFound` if directory not found.
* Throws `Deno.errors.PermissionDenied` if the user does not have access
* rights
*/
export function chdir(directory: string): void;

Expand Down Expand Up @@ -2340,16 +2347,21 @@ declare namespace Deno {
): Promise<[DiagnosticItem[] | undefined, Record<string, string>]>;

/** **UNSTABLE**: new API, yet to be vetted.
*
* `bundle()` is part the compiler API. A full description of this functionality
* can be found in the [manual](https://deno.land/std/manual.md#denobundle).
*
* Takes a root module name, and optionally a record set of sources. Resolves
* with a single JavaScript string that is like the output of a `deno bundle`
* command. If just a root name is provided, the modules will be resolved as if
* the root module had been passed on the command line.
* with a single JavaScript string (and bundle diagnostics if issues arise with
* the bundling) that is like the output of a `deno bundle` command. If just
* a root name is provided, the modules will be resolved as if the root module
* had been passed on the command line.
*
* If sources are passed, all modules will be resolved out of this object, where
* the key is the module name and the value is the content. The extension of the
* module name will be used to determine the media type of the module.
*
* //equivalent to "deno bundle foo.ts" from the command line
* const [ maybeDiagnostics1, output1 ] = await Deno.bundle("foo.ts");
*
* const [ maybeDiagnostics2, output2 ] = await Deno.bundle("/foo.ts", {
Expand Down

0 comments on commit 2a34cbf

Please sign in to comment.