Skip to content

Latest commit

 

History

History
51 lines (44 loc) · 1.11 KB

IDL.md

File metadata and controls

51 lines (44 loc) · 1.11 KB

Proposed WebIDL

Definition of ContentIndex

enum ContentCategory {
    "",
    "homepage",
    "article",
    "video",
    "audio",
    // ...
};

dictionary ContentDescription {
    required DOMString id;
    required DOMString title;
    required DOMString description;
    ContentCategory category = "";
    sequence<ImageResource> icons = [];
    required USVString url;
};

interface ContentIndex {
    Promise<undefined> add(ContentDescription description);
    Promise<undefined> delete(DOMString id);
    Promise<sequence<ContentDescription>> getAll();
};

Additions to the Service Worker Registration

partial interface ServiceWorkerRegistration {
    [SameObject] readonly attribute ContentIndex index;
};

Additions to the Service Worker Global Scope

dictionary ContentIndexEventInit : ExtendableEventInit {
    required DOMString id;
};

interface ContentIndexEvent : ExtendableEvent {
  constructor(DOMString type, ContentIndexEventInit init);
  readonly attribute DOMString id;
};

partial interface ServiceWorkerGlobalScope {
    attribute EventHandler oncontentdelete;
};