Skip to content

Commit

Permalink
Remove @url comments from d.ts files (denoland#4449)
Browse files Browse the repository at this point in the history
These have no function and are not tested, probably incorrect in many
situations.
  • Loading branch information
ry committed Mar 21, 2020
1 parent b8a5c29 commit 12ff78e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 70 deletions.
46 changes: 0 additions & 46 deletions cli/js/lib.deno.ns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,6 @@ declare namespace Deno {
*/
export function execPath(): string;

// @url js/dir.d.ts

/**
* **UNSTABLE**: maybe needs permissions.
*
Expand Down Expand Up @@ -382,8 +380,6 @@ declare namespace Deno {
export const EOF: unique symbol;
export type EOF = typeof EOF;

// @url js/io.d.ts

/** **UNSTABLE**: might remove `"SEEK_"` prefix. Might not use all-caps. */
export enum SeekMode {
SEEK_START = 0,
Expand Down Expand Up @@ -518,8 +514,6 @@ declare namespace Deno {
*/
export function toAsyncIterator(r: Reader): AsyncIterableIterator<Uint8Array>;

// @url js/files.d.ts

/** Synchronously open a file and return an instance of the `File` object.
*
* const file = Deno.openSync("/foo/bar.txt", { read: true, write: true });
Expand Down Expand Up @@ -716,8 +710,6 @@ declare namespace Deno {
*/
export type OpenMode = "r" | "r+" | "w" | "w+" | "a" | "a+" | "x" | "x+";

// @url js/tty.d.ts

/** **UNSTABLE**: newly added API
*
* Check if a given resource is TTY. */
Expand All @@ -728,8 +720,6 @@ declare namespace Deno {
* Set TTY to be under raw mode or not. */
export function setRaw(rid: number, mode: boolean): void;

// @url js/buffer.d.ts

/** A variable-sized buffer of bytes with `read()` and `write()` methods.
*
* Based on [Go Buffer](https://golang.org/pkg/bytes/#Buffer). */
Expand Down Expand Up @@ -816,8 +806,6 @@ declare namespace Deno {
/** Synchronously write all the content of `arr` to `w`. */
export function writeAllSync(w: SyncWriter, arr: Uint8Array): void;

// @url js/mkdir.d.ts

export interface MkdirOptions {
/** Defaults to `false`. If set to `true`, means that any intermediate
* directories will also be created (as with the shell command `mkdir -p`).
Expand Down Expand Up @@ -861,8 +849,6 @@ declare namespace Deno {
mode?: number
): Promise<void>;

// @url js/make_temp.d.ts

export interface MakeTempOptions {
/** Directory where the temporary directory should be created (defaults to
* the env variable TMPDIR, or the system's default, usually /tmp). */
Expand Down Expand Up @@ -941,8 +927,6 @@ declare namespace Deno {
* Requires `allow-write` permission. */
export function makeTempFile(options?: MakeTempOptions): Promise<string>;

// @url js/chmod.d.ts

/** Synchronously changes the permission of a specific file/directory of
* specified path. Ignores the process's umask.
*
Expand Down Expand Up @@ -983,8 +967,6 @@ declare namespace Deno {
* Requires `allow-write` permission. */
export function chmod(path: string, mode: number): Promise<void>;

// @url js/chown.d.ts

/** Synchronously change owner of a regular file or directory. Linux/Mac OS
* only at the moment.
*
Expand All @@ -1007,8 +989,6 @@ declare namespace Deno {
*/
export function chown(path: string, uid: number, gid: number): Promise<void>;

// @url js/utime.d.ts

/** **UNSTABLE**: needs investigation into high precision time.
*
* Synchronously changes the access and modification times of a file system
Expand Down Expand Up @@ -1039,8 +1019,6 @@ declare namespace Deno {
mtime: number | Date
): Promise<void>;

// @url js/remove.d.ts

export interface RemoveOptions {
/** Defaults to `false`. If set to `true`, path will be removed even if
* it's a non-empty directory. */
Expand All @@ -1065,8 +1043,6 @@ declare namespace Deno {
* Requires `allow-write` permission. */
export function remove(path: string, options?: RemoveOptions): Promise<void>;

// @url js/rename.d.ts

/** Synchronously renames (moves) `oldpath` to `newpath`. If `newpath` already
* exists and is not a directory, `renameSync()` replaces it. OS-specific
* restrictions may apply when `oldpath` and `newpath` are in different
Expand All @@ -1086,8 +1062,6 @@ declare namespace Deno {
* Requires `allow-read` and `allow-write`. */
export function rename(oldpath: string, newpath: string): Promise<void>;

// @url js/read_file.d.ts

/** Reads and returns the entire contents of a file.
*
* const decoder = new TextDecoder("utf-8");
Expand All @@ -1106,8 +1080,6 @@ declare namespace Deno {
* Requires `allow-read` permission. */
export function readFile(path: string): Promise<Uint8Array>;

// @url js/file_info.d.ts

/** A FileInfo describes a file and is returned by `stat`, `lstat`,
* `statSync`, `lstatSync`. A list of FileInfo is returned by `readdir`,
* `readdirSync`. */
Expand Down Expand Up @@ -1176,8 +1148,6 @@ declare namespace Deno {
isSymlink(): boolean;
}

// @url js/realpath.d.ts

/** Returns absolute normalized path with, symbolic links resolved.
*
* const realPath = Deno.realpathSync("./some/path");
Expand All @@ -1192,8 +1162,6 @@ declare namespace Deno {
* Requires `allow-read` permission. */
export function realpath(path: string): Promise<string>;

// @url js/read_dir.d.ts

/** UNSTABLE: need to consider streaming case
*
* Synchronously reads the directory given by `path` and returns an array of
Expand All @@ -1213,8 +1181,6 @@ declare namespace Deno {
* Requires `allow-read` permission. */
export function readdir(path: string): Promise<FileInfo[]>;

// @url js/copy_file.d.ts

/** Synchronously copies the contents and permissions of one file to another
* specified path, by default creating a new file if needed, else overwriting.
* Fails if target path is a directory or is unwritable.
Expand All @@ -1235,8 +1201,6 @@ declare namespace Deno {
* Requires `allow-write` permission on toPath. */
export function copyFile(fromPath: string, toPath: string): Promise<void>;

// @url js/read_link.d.ts

/** Returns the destination of the named symbolic link.
*
* const targetPath = Deno.readlinkSync("symlink/path");
Expand All @@ -1251,8 +1215,6 @@ declare namespace Deno {
* Requires `allow-read` permission. */
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
* symlink, information for the symlink will be returned.
*
Expand Down Expand Up @@ -1289,8 +1251,6 @@ declare namespace Deno {
* Requires `allow-read` permission. */
export function statSync(path: string): FileInfo;

// @url js/link.d.ts

/** Creates `newpath` as a hard link to `oldpath`.
*
* Deno.linkSync("old/name", "new/name");
Expand All @@ -1305,8 +1265,6 @@ declare namespace Deno {
* Requires `allow-read` and `allow-write` permissions. */
export function link(oldpath: string, newpath: string): Promise<void>;

// @url js/symlink.d.ts

/** **UNSTABLE**: `type` argument type may be changed to `"dir" | "file"`.
*
* Creates `newpath` as a symbolic link to `oldpath`. The type argument can be
Expand Down Expand Up @@ -1337,8 +1295,6 @@ declare namespace Deno {
type?: string
): Promise<void>;

// @url js/write_file.d.ts

/** Options for writing to a file. */
export interface WriteFileOptions {
/** Defaults to `false`. If set to `true`, will append to a file instead of
Expand Down Expand Up @@ -1533,8 +1489,6 @@ declare namespace Deno {
constructor(state: PermissionState);
}

// @url js/truncate.d.ts

/** Synchronously truncates or extends the specified file, to reach the
* specified `len`.
*
Expand Down
24 changes: 0 additions & 24 deletions cli/js/lib.deno.shared_globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,6 @@ declare interface ImportMeta {
}

declare namespace __domTypes {
// @url js/dom_types.d.ts

export type BufferSource = ArrayBufferView | ArrayBuffer;
export type HeadersInit =
| Headers
Expand Down Expand Up @@ -872,8 +870,6 @@ declare namespace __domTypes {
}

declare namespace __blob {
// @url js/blob.d.ts

export const bytesSymbol: unique symbol;
export const blobBytesWeakMap: WeakMap<__domTypes.Blob, Uint8Array>;
export class DenoBlob implements __domTypes.Blob {
Expand All @@ -890,8 +886,6 @@ declare namespace __blob {
}

declare namespace __console {
// @url js/console.d.ts

type ConsoleOptions = Partial<{
showHidden: boolean;
depth: number;
Expand Down Expand Up @@ -979,8 +973,6 @@ declare namespace __console {
}

declare namespace __event {
// @url js/event.d.ts

export const eventAttributes: WeakMap<object, any>;
export class EventInit implements __domTypes.EventInit {
bubbles: boolean;
Expand Down Expand Up @@ -1052,8 +1044,6 @@ declare namespace __event {
}

declare namespace __customEvent {
// @url js/custom_event.d.ts

export const customEventAttributes: WeakMap<object, any>;
export class CustomEventInit extends __event.EventInit
implements __domTypes.CustomEventInit {
Expand All @@ -1080,8 +1070,6 @@ declare namespace __customEvent {
}

declare namespace __eventTarget {
// @url js/event_target.d.ts

export class EventListenerOptions implements __domTypes.EventListenerOptions {
_capture: boolean;
constructor({ capture }?: { capture?: boolean | undefined });
Expand Down Expand Up @@ -1223,8 +1211,6 @@ declare namespace __io {
}

declare namespace __fetch {
// @url js/fetch.d.ts

class Body
implements __domTypes.Body, __domTypes.ReadableStream, __io.ReadCloser {
private rid;
Expand Down Expand Up @@ -1285,8 +1271,6 @@ declare namespace __fetch {
}

declare namespace __textEncoding {
// @url js/text_encoding.d.ts

export function atob(s: string): string;
/** Creates a base-64 ASCII string from the input string. */
export function btoa(s: string): string;
Expand Down Expand Up @@ -1328,8 +1312,6 @@ declare namespace __textEncoding {
}

declare namespace __timers {
// @url js/timers.d.ts

export type Args = unknown[];
/** Sets a timer which executes a function once after the timer expires. */
export function setTimeout(
Expand All @@ -1348,8 +1330,6 @@ declare namespace __timers {
}

declare namespace __urlSearchParams {
// @url js/url_search_params.d.ts

export class URLSearchParams {
private params;
private url;
Expand Down Expand Up @@ -1455,7 +1435,6 @@ declare namespace __urlSearchParams {
}

declare namespace __url {
// @url js/url.d.ts
export interface URL {
hash: string;
host: string;
Expand All @@ -1482,7 +1461,6 @@ declare namespace __url {
}

declare namespace __workers {
// @url js/workers.d.ts
export interface Worker {
onerror?: (e: Event) => void;
onmessage?: (e: { data: any }) => void;
Expand All @@ -1509,8 +1487,6 @@ declare namespace __workers {
}

declare namespace __performanceUtil {
// @url js/performance.d.ts

export class Performance {
/** Returns a current time from Deno's start in milliseconds.
*
Expand Down

0 comments on commit 12ff78e

Please sign in to comment.