Skip to content

ClipboardItemData interface type missing array and function properties #1000

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
wffurr opened this issue Apr 14, 2021 · 2 comments
Closed

ClipboardItemData interface type missing array and function properties #1000

wffurr opened this issue Apr 14, 2021 · 2 comments

Comments

@wffurr
Copy link

wffurr commented Apr 14, 2021

I tried generating the typings for the async Clipboard API in wffurr@9c8bc4b and the generated ClipboardItemData type is missing the types and getType properties from the IDL: https://w3c.github.io/clipboard-apis/#clipboard-interface

interface ClipboardItem {
  constructor(record<DOMString, ClipboardItemData> items,
    optional ClipboardItemOptions options = {});
  static ClipboardItem createDelayed(
      record<DOMString, ClipboardItemDelayedCallback> items,
      optional ClipboardItemOptions options = {});

  readonly attribute PresentationStyle presentationStyle;
  readonly attribute long long lastModified;
  readonly attribute boolean delayed;

  readonly attribute FrozenArray<DOMString> types;
  Promise<Blob> getType(DOMString type);
};

turns into this generated type: wffurr@9c8bc4b#diff-d57c51d024219b9f37e6b42df127db25f700acbaade23ce1edcecda2853b995cR3587

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;
};

The interface should have readonly types: string[] and getType(type: string): Promise<Blob>.

@saschanaz
Copy link
Contributor

#1034 added those two.

@github-actions close

@github-actions
Copy link
Contributor

Closing because @saschanaz is one of the code-owners of this repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants