Skip to content

Commit

Permalink
rethink API shape
Browse files Browse the repository at this point in the history
  • Loading branch information
inexorabletash committed Apr 17, 2020
1 parent c9a63ce commit 657b7aa
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2739,8 +2739,7 @@ interface IDBObjectStore {
optional [EnforceRange] unsigned long count);
[NewObject] IDBRequest getAllKeys(optional any query,
optional [EnforceRange] unsigned long count);
[NewObject] IDBRequest getAllEntries(optional any query,
optional [EnforceRange] unsigned long count);
[NewObject] IDBRequest getAllEntries(optional IDBGetAllEntriesOptions options = {});
[NewObject] IDBRequest count(optional any query);

[NewObject] IDBRequest openCursor(optional any query,
Expand All @@ -2760,6 +2759,12 @@ dictionary IDBIndexParameters {
boolean unique = false;
boolean multiEntry = false;
};

dictionary IDBGetAllEntriesOptions {
any query = null;
[EnforceRange] unsigned long count;
IDBCursorDirection direction = "next";
};
</xmp>

<div class="domintro note">
Expand Down Expand Up @@ -3119,15 +3124,13 @@ must run these steps:
be an [=Array=] of the [=/keys=].

: |request| = |store| .
{{IDBObjectStore/getAllEntries()|getAllEntries}}(<var>query</var> [,
|count|])
{{IDBObjectStore/getAllEntries()|getAllEntries}}(|options|)
::
Retrieves the [=/keys=] and [=/values=] of [=object-store/records=] matching the
given [=/key=] or [=key range=] in |query| (up to |count| if given).
Retrieves multiple [=/keys=] and [=/values=] of [=object-store/records=].

If successful, |request|'s {{IDBRequest/result}} will
be an [=Array=], with each member being an [=Array=] with a [=/key=]
[=/value=] pair.
The |query| option specifies a [=/key=] or [=key range=] to match. The |count| option limits the number or records matched. Set the |direction| option to {{"next"}} to retrieve the first |count| records, or {{"prev"}} to return the last |count| records.

If successful, |request|'s {{IDBRequest/result}} will be an [=Array=], with each member being an [=Array=] with a [=/key=] [=/value=] pair.

: |request| = |store| .
{{IDBObjectStore/count()|count}}(|query|)
Expand Down Expand Up @@ -3700,8 +3703,7 @@ interface IDBIndex {
optional [EnforceRange] unsigned long count);
[NewObject] IDBRequest getAllKeys(optional any query,
optional [EnforceRange] unsigned long count);
[NewObject] IDBRequest getAllEntries(optional any query,
optional [EnforceRange] unsigned long count);
[NewObject] IDBRequest getAllEntries(optional IDBGetAllEntriesOptions options = {});
[NewObject] IDBRequest count(optional any query);

[NewObject] IDBRequest openCursor(optional any query,
Expand Down Expand Up @@ -3850,8 +3852,7 @@ return [=/this=]'s [=index-handle/index=]'s [=unique flag=].


: |request| = |index| .
{{IDBIndex/getAllEntries()|getAllEntries}}(<var>query</var> [,
|count|])
{{IDBIndex/getAllEntries()|getAllEntries}}(|query| [, |count|])
::
Retrieves the [=/keys=], [=/values=], and index [=/keys=] of [=object-store/records=] matching the given
[=/key=] or [=key range=] in |query| (up to |count| if given).
Expand Down

0 comments on commit 657b7aa

Please sign in to comment.