Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add code generation for @types/deno #25545

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
21 changes: 15 additions & 6 deletions cli/tsc/dts/lib.deno.ns.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @category Platform
*/
declare interface ImportMeta {
interface ImportMeta {
dsherret marked this conversation as resolved.
Show resolved Hide resolved
/** A string representation of the fully qualified module URL. When the
* module is loaded locally, the value will be a file URL (e.g.
* `file:///path/module.ts`).
Expand Down Expand Up @@ -89,7 +89,7 @@ declare interface ImportMeta {
*
* @category Performance
*/
declare interface Performance {
interface Performance {
/** Stores a timestamp with the associated name (a "mark"). */
mark(markName: string, options?: PerformanceMarkOptions): PerformanceMark;

Expand All @@ -109,7 +109,7 @@ declare interface Performance {
*
* @category Performance
*/
declare interface PerformanceMarkOptions {
interface PerformanceMarkOptions {
/** Metadata to be included in the mark. */
// deno-lint-ignore no-explicit-any
detail?: any;
Expand All @@ -126,7 +126,7 @@ declare interface PerformanceMarkOptions {
*
* @category Performance
*/
declare interface PerformanceMeasureOptions {
interface PerformanceMeasureOptions {
/** Metadata to be included in the measure. */
// deno-lint-ignore no-explicit-any
detail?: any;
Expand Down Expand Up @@ -317,6 +317,7 @@ declare namespace Deno {
*
* @category Errors */
export class NotADirectory extends Error {}

/**
* Raised when trying to perform an operation while the relevant Deno
* permission (like `--allow-read`) has not been granted.
Expand All @@ -326,6 +327,8 @@ declare namespace Deno {
*
* @category Errors */
export class NotCapable extends Error {}

export {}; // only export exports
}

/** The current process ID of this instance of the Deno CLI.
Expand Down Expand Up @@ -5432,7 +5435,9 @@ declare namespace Deno {
*
* @category FFI
*/
export type NativeStructType = { readonly struct: readonly NativeType[] };
export interface NativeStructType {
readonly struct: readonly NativeType[];
}

/**
* @category FFI
Expand Down Expand Up @@ -5722,7 +5727,9 @@ declare namespace Deno {
*
* @category FFI
*/
export type PointerObject<T = unknown> = { [brand]: T };
export interface PointerObject<T = unknown> {
[brand]: T;
}

/** Pointers are represented either with a {@linkcode PointerObject}
* object or a `null` if the pointer is null.
Expand Down Expand Up @@ -6166,4 +6173,6 @@ declare namespace Deno {
export function createHttpClient(
options: CreateHttpClientOptions & TlsCertifiedKeyPem,
): HttpClient;

export {}; // only export exports
}
42 changes: 21 additions & 21 deletions cli/tsc/dts/lib.deno.shared_globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ declare function clearInterval(id?: number): void;
declare function clearTimeout(id?: number): void;

/** @category Platform */
declare interface VoidFunction {
interface VoidFunction {
(): void;
}

Expand Down Expand Up @@ -444,7 +444,7 @@ declare function queueMicrotask(func: VoidFunction): void;
declare function dispatchEvent(event: Event): boolean;

/** @category Platform */
declare interface DOMStringList {
interface DOMStringList {
/** Returns the number of strings in strings. */
readonly length: number;
/** Returns true if strings contains string, and false otherwise. */
Expand All @@ -455,13 +455,13 @@ declare interface DOMStringList {
}

/** @category Platform */
declare type BufferSource = ArrayBufferView | ArrayBuffer;
type BufferSource = ArrayBufferView | ArrayBuffer;

/** @category I/O */
declare var console: Console;

/** @category Events */
declare interface ErrorEventInit extends EventInit {
interface ErrorEventInit extends EventInit {
message?: string;
filename?: string;
lineno?: number;
Expand All @@ -470,7 +470,7 @@ declare interface ErrorEventInit extends EventInit {
}

/** @category Events */
declare interface ErrorEvent extends Event {
interface ErrorEvent extends Event {
readonly message: string;
readonly filename: string;
readonly lineno: number;
Expand All @@ -485,13 +485,13 @@ declare var ErrorEvent: {
};

/** @category Events */
declare interface PromiseRejectionEventInit extends EventInit {
interface PromiseRejectionEventInit extends EventInit {
promise: Promise<any>;
reason?: any;
}

/** @category Events */
declare interface PromiseRejectionEvent extends Event {
interface PromiseRejectionEvent extends Event {
readonly promise: Promise<any>;
readonly reason: any;
}
Expand All @@ -506,24 +506,24 @@ declare var PromiseRejectionEvent: {
};

/** @category Workers */
declare interface AbstractWorkerEventMap {
interface AbstractWorkerEventMap {
"error": ErrorEvent;
}

/** @category Workers */
declare interface WorkerEventMap extends AbstractWorkerEventMap {
interface WorkerEventMap extends AbstractWorkerEventMap {
"message": MessageEvent;
"messageerror": MessageEvent;
}

/** @category Workers */
declare interface WorkerOptions {
interface WorkerOptions {
type?: "classic" | "module";
name?: string;
}

/** @category Workers */
declare interface Worker extends EventTarget {
interface Worker extends EventTarget {
onerror: (this: Worker, e: ErrorEvent) => any | null;
onmessage: (this: Worker, e: MessageEvent) => any | null;
onmessageerror: (this: Worker, e: MessageEvent) => any | null;
Expand Down Expand Up @@ -559,10 +559,10 @@ declare var Worker: {
};

/** @category Performance */
declare type PerformanceEntryList = PerformanceEntry[];
type PerformanceEntryList = PerformanceEntry[];

/** @category Performance */
declare interface Performance extends EventTarget {
interface Performance extends EventTarget {
/** Returns a timestamp representing the start of the performance measurement. */
readonly timeOrigin: number;

Expand Down Expand Up @@ -616,7 +616,7 @@ declare var Performance: {
declare var performance: Performance;

/** @category Performance */
declare interface PerformanceMarkOptions {
interface PerformanceMarkOptions {
/** Metadata to be included in the mark. */
detail?: any;

Expand All @@ -625,7 +625,7 @@ declare interface PerformanceMarkOptions {
}

/** @category Performance */
declare interface PerformanceMeasureOptions {
interface PerformanceMeasureOptions {
/** Metadata to be included in the measure. */
detail?: any;

Expand All @@ -647,7 +647,7 @@ declare interface PerformanceMeasureOptions {
*
* @category Performance
*/
declare interface PerformanceEntry {
interface PerformanceEntry {
readonly duration: number;
readonly entryType: string;
readonly name: string;
Expand All @@ -674,7 +674,7 @@ declare var PerformanceEntry: {
*
* @category Performance
*/
declare interface PerformanceMark extends PerformanceEntry {
interface PerformanceMark extends PerformanceEntry {
readonly detail: any;
readonly entryType: "mark";
}
Expand All @@ -698,7 +698,7 @@ declare var PerformanceMark: {
*
* @category Performance
*/
declare interface PerformanceMeasure extends PerformanceEntry {
interface PerformanceMeasure extends PerformanceEntry {
readonly detail: any;
readonly entryType: "measure";
}
Expand All @@ -716,12 +716,12 @@ declare var PerformanceMeasure: {
};

/** @category Events */
declare interface CustomEventInit<T = any> extends EventInit {
interface CustomEventInit<T = any> extends EventInit {
detail?: T;
}

/** @category Events */
declare interface CustomEvent<T = any> extends Event {
interface CustomEvent<T = any> extends Event {
/** Returns any custom data event was created with. Typically used for
* synthetic events. */
readonly detail: T;
Expand All @@ -734,7 +734,7 @@ declare var CustomEvent: {
};

/** @category Platform */
declare interface ErrorConstructor {
interface ErrorConstructor {
/** See https://v8.dev/docs/stack-trace-api#stack-trace-collection-for-custom-exceptions. */
captureStackTrace(error: Object, constructor?: Function): void;
// TODO(nayeemrmn): Support `Error.prepareStackTrace()`. We currently use this
Expand Down
Loading