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
8 changes: 4 additions & 4 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
38 changes: 23 additions & 15 deletions cli/tsc/dts/lib.deno.unstable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ declare namespace Deno {
* @category FFI
* @experimental
*/
export type NativeStructType = { readonly struct: readonly NativeType[] };
export interface NativeStructType {
readonly struct: readonly NativeType[];
}

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

/** **UNSTABLE**: New API, yet to be vetted.
*
Expand All @@ -489,7 +493,7 @@ declare namespace Deno {
static equals<T = unknown>(a: PointerValue<T>, b: PointerValue<T>): boolean;
/** Return the direct memory pointer to the typed array in memory. */
static of<T = unknown>(
value: Deno.UnsafeCallback | BufferSource,
value: UnsafeCallback | BufferSource,
): PointerValue<T>;
/** Return a new pointer offset from the original by `offset` bytes. */
static offset<T = unknown>(
Expand Down Expand Up @@ -833,8 +837,8 @@ declare namespace Deno {
export class UnsafeWindowSurface {
constructor(
system: "cocoa" | "win32" | "x11" | "wayland",
windowHandle: Deno.PointerValue<unknown>,
displayHandle: Deno.PointerValue<unknown>,
windowHandle: PointerValue<unknown>,
displayHandle: PointerValue<unknown>,
);
getContext(context: "webgpu"): GPUCanvasContext;
present(): void;
Expand Down Expand Up @@ -1147,7 +1151,7 @@ declare namespace Deno {
* @category Cloud
* @experimental
*/
export function openKv(path?: string): Promise<Deno.Kv>;
export function openKv(path?: string): Promise<Kv>;

/** **UNSTABLE**: New API, yet to be vetted.
*
Expand Down Expand Up @@ -1410,7 +1414,11 @@ declare namespace Deno {
* @category Cloud
* @experimental
*/
export type KvEntry<T> = { key: KvKey; value: T; versionstamp: string };
export interface KvEntry<T> {
key: KvKey;
value: T;
versionstamp: string;
}

/**
* **UNSTABLE**: New API, yet to be vetted.
Expand Down Expand Up @@ -1615,7 +1623,7 @@ declare namespace Deno {
value: unknown,
options?: {
delay?: number;
keysIfUndelivered?: Deno.KvKey[];
keysIfUndelivered?: KvKey[];
backoffSchedule?: number[];
},
): this;
Expand Down Expand Up @@ -1846,7 +1854,7 @@ declare namespace Deno {
value: unknown,
options?: {
delay?: number;
keysIfUndelivered?: Deno.KvKey[];
keysIfUndelivered?: KvKey[];
backoffSchedule?: number[];
},
): Promise<KvCommitResult>;
Expand Down Expand Up @@ -1976,18 +1984,18 @@ declare namespace Deno {
* @category Jupyter
* @experimental
*/
export type VegaObject = {
export interface VegaObject {
$schema: string;
[key: string]: unknown;
};
}

/**
* A collection of supported media types and data for Jupyter frontends.
*
* @category Jupyter
* @experimental
*/
export type MediaBundle = {
export interface MediaBundle {
"text/plain"?: string;
"text/html"?: string;
"image/svg+xml"?: string;
Expand All @@ -2013,7 +2021,7 @@ declare namespace Deno {

// Must support a catch all for custom media types / mimetypes
[key: string]: string | object | undefined;
};
}

/**
* @category Jupyter
Expand All @@ -2025,9 +2033,9 @@ declare namespace Deno {
* @category Jupyter
* @experimental
*/
export type Displayable = {
export interface Displayable {
[$display]: () => MediaBundle | Promise<MediaBundle>;
};
}

/**
* Display function for Jupyter Deno Kernel.
Expand Down
Loading
Loading