Skip to content

Update StorageEvent interface #6295

Closed
microsoft/TypeScript-DOM-lib-generator
#48

Description

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.

Activity

  1. DanielRosenwasser commented on Dec 30, 2015

    @DanielRosenwasser
    Member

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

  2. falsandtru commented on Dec 30, 2015

    @falsandtru
    ContributorAuthor

    Okay.

  3. added this to the milestone on Jan 7, 2016
  4. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeWould introduce errors in existing codeBugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions