/* * Copyright (C)2005-2013 Haxe Foundation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ // This file is generated, do not edit! package js.html.idb; /**

The IDBIndex interface of the IndexedDB API provides asynchronous access to an index in a database. An index is a kind of object store for looking up records in another object store, called the referenced object store. You use this interface to retrieve data.

Inherits from: EventTarget



Documentation for this class was provided by MDN. */ @:native("IDBIndex") extern class Index { var keyPath(default,null) : Any; var multiEntry(default,null) : Bool; var name(default,null) : String; var objectStore(default,null) : ObjectStore; var unique(default,null) : Bool; /**

Returns an IDBRequest object, and in a separate thread, returns the number of records within a key range. For example, if you want to see how many records are between keys 1000 and 2000 in an object store, you can write the following: var req = store.count(IDBKeyRange.bound(1000, 2000));

IDBRequest count (
  in optional any key
) raises (IDBDatabaseException);
Parameters
key
The key or key range that identifies the record to be counted.
Returns
IDBRequest
A request object on which subsequent events related to this operation are fired.
Exceptions

This method can raise a IDBDatabaseException with the following code:

Attribute Description
DATA_ERR The key parameter was not a valid value.
NOT_ALLOWED_ERR The request was made on a source object that has been deleted or removed.
Throws DatabaseException. */ @:overload( function( ?range : KeyRange ) :Request {} ) function count( key : Key ) : Request; /**

Returns an IDBRequest object, and, in a separate thread, finds either:

If a value is successfully found, then a structured clone of it is created and set as the result of the request object.

Note: This method produces the same result for: a) a record that doesn't exist in the database and b) a record that has an undefined value. To tell these situations apart, call the openCursor() method with the same key. That method provides a cursor if the record exists, and not if it does not.

IDBRequest get (
  in any key
) raises (IDBDatabaseException);
Parameters
key
The key or key range that identifies the record to be retrieved.
Returns
IDBRequest
A request object on which subsequent events related to this operation are fired.
Exceptions

This method can raise an IDBDatabaseException with the following code:

Attribute Description
TRANSACTION_INACTIVE_ERR The index's transaction is not active.
DATA_ERR The key parameter was not a valid value.
NOT_ALLOWED_ERR The request was made on a source object that has been deleted or removed.
Throws DatabaseException. */ @:overload( function( key : KeyRange ) :Request {} ) function get( key : Key ) : Request; /**

Returns an IDBRequest object, and, in a separate thread, finds either:

If a value is successfully found, then a structured clone of it is created and set as the result of the request object.

Note: This method produces the same result for: a) a record that doesn't exist in the database and b) a record that has an undefined value. To tell these situations apart, call the openCursor() method with the same key. That method provides a cursor if the record exists, and not if it does not.

IDBRequest getKey (
  in any key
) raises (IDBDatabaseException);
Parameters
key
The key or key range that identifies the record to be retrieved.
Returns
IDBRequest
A request object on which subsequent events related to this operation are fired.
Exceptions

This method can raise a IDBDatabaseException with the following code:

Attribute Description
TRANSACTION_INACTIVE_ERR The index's transaction is not active.
DATA_ERR The key parameter was not a valid value.
NOT_ALLOWED_ERR The request was made on a source object that has been deleted or removed.
Throws DatabaseException. */ @:overload( function( key : KeyRange ) :Request {} ) function getKey( key : Key ) : Request; /**

Returns an IDBRequest object, and, in a separate thread, creates a cursor over the specified key range. The method sets the position of the cursor to the appropriate record, based on the specified direction.

IDBRequest openCursor (
  in optional any? range, 
  in optional unsigned short direction
) raises (IDBDatabaseException);
Parameters
range
Optional. The key range to use as the cursor's range.
direction
Optional. The cursor's required direction. See IDBCursor Constants for possible values.
Returns
IDBRequest
A request object on which subsequent events related to this operation are fired.
Exceptions

This method can raise an IDBDatabaseException with the following code:

Attribute Description
TRANSACTION_INACTIVE_ERR The index's transaction is not active.
DATA_ERR The key parameter was not a valid value.
NOT_ALLOWED_ERR The request was made on a source object that has been deleted or removed.
Throws DatabaseException. */ @:overload( function( ?range : KeyRange, ?direction : String ) :Request {} ) function openCursor( key : Key, ?direction : String ) : Request; /**

Returns an IDBRequest object, and, in a separate thread, creates a cursor over the specified key range, as arranged by this index. The method sets the position of the cursor to the appropriate record, based on the specified direction.

IDBRequest openKeyCursor (
  in optional any? range, 
  in optional unsigned short direction
) raises (IDBDatabaseException);
Parameters
range
Optional. The key range to use as the cursor's range.
direction
Optional. The cursor's required direction. See IDBCursor Constants for possible values.
Returns
IDBRequest
A request object on which subsequent events related to this operation are fired.
Exceptions

This method can raise an IDBDatabaseException with the following code:

Attribute Description
TRANSACTION_INACTIVE_ERR The index's transaction is not active.
DATA_ERR The key parameter was not a valid value.
NOT_ALLOWED_ERR The request was made on a source object that has been deleted or removed.
Throws DatabaseException. */ @:overload( function( ?range : KeyRange, ?direction : String ) :Request {} ) function openKeyCursor( key : Key, ?direction : String ) : Request; }