Skip to content

Update StorageEvent interface #6295

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
falsandtru opened this issue Dec 30, 2015 · 2 comments · Fixed by microsoft/TypeScript-DOM-lib-generator#48
Closed

Update StorageEvent interface #6295

falsandtru opened this issue Dec 30, 2015 · 2 comments · Fixed by microsoft/TypeScript-DOM-lib-generator#48
Labels
Breaking Change Would introduce errors in existing code Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this

Comments

@falsandtru
Copy link
Contributor

new StorageEvent(); // Uncaught TypeError: Illegal constructor(…)
interface StorageEvent extends Event {
    key: string;
    newValue: any;
    oldValue: any;
    storageArea: Storage;
    url: string;
    initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void;
}

declare var StorageEvent: {
    prototype: StorageEvent;
    new(): StorageEvent;
}

https://github.com/Microsoft/TypeScript/blob/master/lib/lib.dom.d.ts

[Constructor(DOMString type, optional StorageEventInit eventInitDict)]
interface StorageEvent : Event {
  readonly attribute DOMString? key;
  readonly attribute DOMString? oldValue;
  readonly attribute DOMString? newValue;
  readonly attribute DOMString url;
  readonly attribute Storage? storageArea;
};

dictionary StorageEventInit : EventInit {
  DOMString? key;
  DOMString? oldValue;
  DOMString? newValue;
  DOMString url;
  Storage? storageArea;
};

http://www.w3.org/TR/webstorage/#the-storage-event

  • Constructor requires a first parameter.
  • Constructor optional parameter type is dict.
  • Require StorageEventInit interface.
  • newValue and oldValue are string.
  • StorageEventInit requires url field.
@DanielRosenwasser
Copy link
Member

I think we'd be willing to take a PR on https://github.com/Microsoft/TSJS-lib-generator

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Help Wanted You can do this Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Good First Issue Well scoped, documented and has the green light labels Dec 30, 2015
@falsandtru
Copy link
Contributor Author

Okay.

@mhegazy mhegazy added this to the Community milestone Jan 7, 2016
@mhegazy mhegazy added the Breaking Change Would introduce errors in existing code label Jan 15, 2016
@falsandtru falsandtru changed the title StorageEvent definition Update StorageEvent interface Jan 15, 2016
@zhengbli zhengbli added Fixed A PR has been merged for this issue and removed Fixed in TSJS repo labels Jan 20, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Breaking Change Would introduce errors in existing code Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants