airpingu / data-store-api

W3C working draft for Data Store API
http://airpingu.github.io/data-store-api/index.html
4 stars 2 forks source link

Use union type "DOMString or unsigned long" to specify the key. #7

Closed airpingu closed 10 years ago

airpingu commented 10 years ago

Please refer to [1], which proposed we should use a union type DOMString or unsigned long to specify the key in the data store. For example,

typedef (DOMString or unsigned long) DataStoreKey;
partial interface DataStore : EventTarget {
  Promise get(DataStoreKey... id);
  Promise put(any obj, DataStoreKey id);
  Promise add(any obj, optional DataStoreKey id);
  Promise remove(DataStoreKey id);
}

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=946316

airpingu commented 10 years ago

https://github.com/airpingu/data-store-api/commit/069cbd0b0717a6df3cd3f995611a636965137a31