Skip to content

Add Missing Clipboard Interfaces #1004

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ interface ClipboardEventInit extends EventInit {
clipboardData?: DataTransfer | null;
}

interface ClipboardItemOptions {
presentationStyle?: PresentationStyle;
}

interface CloseEventInit extends EventInit {
code?: number;
reason?: string;
Expand Down Expand Up @@ -3560,6 +3564,7 @@ declare var ClientRectList: {

interface Clipboard extends EventTarget {
readText(): Promise<string>;
write(data: ClipboardItems): Promise<void>;
writeText(data: string): Promise<void>;
}

Expand All @@ -3578,6 +3583,18 @@ declare var ClipboardEvent: {
new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent;
};

interface ClipboardItem {
readonly delayed: boolean;
readonly lastModified: number;
readonly presentationStyle: PresentationStyle;
}

declare var ClipboardItem: {
prototype: ClipboardItem;
new(items: Record<string, ClipboardItemData>, options?: ClipboardItemOptions): ClipboardItem;
createDelayed(items: Record<string, ClipboardItemDelayedCallback>, options?: ClipboardItemOptions): ClipboardItem;
};

/** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */
interface CloseEvent extends Event {
/**
Expand Down Expand Up @@ -18905,6 +18922,10 @@ interface BlobCallback {
(blob: Blob | null): void;
}

interface ClipboardItemDelayedCallback {
(): ClipboardItemData;
}

interface CustomElementConstructor {
new (...params: any[]): HTMLElement;
}
Expand Down Expand Up @@ -19651,6 +19672,9 @@ declare function addEventListener<K extends keyof WindowEventMap>(type: K, liste
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
declare function removeEventListener<K extends keyof WindowEventMap>(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
declare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
type ClipboardItems = ClipboardItem[];
type ClipboardItemDataType = string | Blob;
type ClipboardItemData = Promise<ClipboardItemDataType>;
type HeadersInit = Headers | string[][] | Record<string, string>;
type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream<Uint8Array> | string;
type RequestInfo = Request | string;
Expand Down Expand Up @@ -19789,6 +19813,7 @@ type PermissionState = "denied" | "granted" | "prompt";
type PlaybackDirection = "alternate" | "alternate-reverse" | "normal" | "reverse";
type PositionAlignSetting = "auto" | "center" | "line-left" | "line-right";
type PremultiplyAlpha = "default" | "none" | "premultiply";
type PresentationStyle = "attachment" | "inline" | "unspecified";
type PublicKeyCredentialType = "public-key";
type PushEncryptionKeyName = "auth" | "p256dh";
type PushPermissionState = "denied" | "granted" | "prompt";
Expand Down
4 changes: 1 addition & 3 deletions inputfiles/removedTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,10 @@
"Clipboard": {
"methods": {
"method": {
"read": null,
"write": null
"read": null
}
}
},
"ClipboardItem": null,
"Console": null,
"Coordinates": null,
"CSS": null,
Expand Down