/// declare module dstore { export interface FetchArray extends Array { totalLength: number; } export interface FetchPromise extends dojo.promise.Promise { totalLength: dojo.promise.Promise; } export interface ChangeEvent { id: any; index?: number; previousIndex?: number; target: T; totalLength: number; type: string; } export interface Collection { idProperty: string; Model: { new (...args: any[]): T; }; tracking?: { remove(): void; }; add(object: T, options?: {}): dojo.promise.Promise; emit(eventName: string, event: ChangeEvent): boolean; fetch(): dstore.FetchPromise; fetchRange(kwArgs: { start?: number; end?: number; }): dstore.FetchPromise; filter(query: string | {} | { (item: T, index: number): boolean; }): this; forEach(callback: (item: T, index: number) => void, thisObject?: any): dojo.promise.Promise; get(id: any): dojo.promise.Promise; getIdentity(object: T): any; on(eventName: string, listener: (event: ChangeEvent) => void): dojo.Handle; put(object: T, options?: {}): dojo.promise.Promise; remove(id: any): dojo.promise.Promise; sort(property: string | { (a: T, b: T): number; }, descending?: boolean): this; track?(): this; } export interface SyncCollection extends Collection { addSync(object: T, options?: {}): T; fetchSync(): dstore.FetchArray; fetchRangeSync(kwArgs: { start?: number; end?: number; }): dstore.FetchArray; filter(query: string | {} | { (item: T, index: number): boolean; }): this; getSync(id: any): T; putSync(object: T, options?: {}): T; removeSync(id: any): boolean; sort(property: string | { (a: T, b: T): number; }, descending?: boolean): this; track?(): this; } } declare module 'dstore/Cache' { import Store = require('dstore/Store'); interface Cache extends Store { cachingStore: dstore.Collection; evict(id: any): void; } module Cache { export interface Constructor extends dojo._base.DeclareConstructor> { new (kwArgs?: Cache.KwArgs): Cache; } export interface KwArgs extends Store.KwArgs { cachingStore?: dstore.Collection; } } const Cache: Cache.Constructor; export = Cache; } declare module 'dstore/legacy/DstoreAdapter' { import Store = require('dstore/Store'); interface DstoreAdapter { constructor(collection: dstore.Collection): DstoreAdapter; get(id: any): any; put(object: T, options?: {}): any; remove(id: any): any; query(query: any, options?: {}): any; } module DstoreAdapter { export interface Constructor extends dojo._base.DeclareConstructor> { new (store: Store): DstoreAdapter>; } } const DstoreAdapter: DstoreAdapter.Constructor; export = DstoreAdapter; } declare module 'dstore/Memory' { import Store = require('dstore/Store'); interface Memory extends Store, dstore.SyncCollection { data: T[]; addSync(object: T, options?: {}): T; fetchSync(): dstore.FetchArray; fetchRangeSync(kwArgs: { start?: number; end?: number; }): dstore.FetchArray; filter(query: string | {} | { (item: T, index: number): boolean; }): this; getSync(id: any): T; putSync(object: T, options?: {}): T; removeSync(id: any): boolean; setData(data: T[]): void; sort(property: string | { (a: T, b: T): number; }, descending?: boolean): this; track(): this; remove(id: any): dojo.promise.Promise<{}>; } module Memory { export interface Constructor extends dojo._base.DeclareConstructor> { new (kwArgs?: Memory.KwArgs): Memory; } export interface KwArgs extends Store.KwArgs { data?: T[]; } } const Memory: Memory.Constructor; export = Memory; } declare module 'dstore/Trackable' { interface Trackable { currentRange: any[]; track(): this; } module Trackable { export interface Constructor extends dojo._base.DeclareConstructor> { new (...args: any[]): Trackable; } } const Trackable: Trackable.Constructor; export = Trackable; } declare module 'dstore/Tree' { interface Tree { mayHaveChildren(object: T): boolean; getRootCollection(): dstore.Collection; getChildren(object: T): dstore.Collection; } module Tree { export interface Constructor extends dojo._base.DeclareConstructor> { new (...args: any[]): Tree; } } const Tree: Tree.Constructor; export = Tree; } declare module 'dstore/Promised' { import * as Promise from 'dojo/promise/Promise'; interface Promised { get(id: any): Promise; put(object: T, options?: {}): Promise; add(object: T, options?: {}): Promise; remove(id: any): Promise; fetch(): dstore.FetchPromise; fetchRange(args: { start?: number; end?: number; }): dstore.FetchPromise; } module Promised { export interface Constructor extends dojo._base.DeclareConstructor> { new (...args: any[]): Promised; } } const Promised: Promised.Constructor; export = Promised; } declare module 'dstore/SimpleQuery' { interface SimpleQuery { } module SimpleQuery { export interface Constructor extends dojo._base.DeclareConstructor> { new (...args: any[]): SimpleQuery; } } const SimpleQuery: SimpleQuery.Constructor; export = SimpleQuery; } declare module 'dstore/Request' { import Store = require('dstore/Store'); interface Request extends Store { headers: {}; parse: (serializedObject: string) => {}; target: string; ascendingPrefix: string; descendingPrefix: string; accepts: string; track(): this; } module Request { export interface Constructor extends dojo._base.DeclareConstructor> { new (kwArgs?: Request.KwArgs): Request; } export interface KwArgs extends Store.KwArgs { headers?: typeof Request.prototype.headers; parse?: typeof Request.prototype.parse; target?: typeof Request.prototype.target; ascendingPrefix?: typeof Request.prototype.ascendingPrefix; descendingPrefix?: typeof Request.prototype.descendingPrefix; accepts?: typeof Request.prototype.accepts; } } const Request: Request.Constructor; export = Request; } declare module 'dstore/RequestMemory' { import Request = require('dstore/Request'); import Cache = require('dstore/Cache'); interface RequestMemory extends Request, Cache { cachingStore: dstore.Collection; evict(id: any): void; track(): this; } module RequestMemory { export interface Constructor extends dojo._base.DeclareConstructor> { new (kwArgs?: RequestMemory.KwArgs): RequestMemory; } export interface KwArgs extends Request.KwArgs, Cache.KwArgs {} } const RequestMemory: RequestMemory.Constructor; export = RequestMemory; } declare module 'dstore/Rest' { import Request = require('dstore/Request'); interface Rest extends Request {} module Rest { export interface Constructor extends dojo._base.DeclareConstructor> { new (kwArgs?: Request.KwArgs): Rest; } } const Rest: Rest.Constructor; export = Rest; } declare module 'dstore/Store' { interface Store extends dstore.Collection { idProperty: string; Model: { new (...args: any[]): T; }; total: dojo.promise.Promise; add(object: T, options?: {}): dojo.promise.Promise; emit(eventName: string, event: dstore.ChangeEvent): boolean; fetch(): dstore.FetchPromise; fetchRange(kwArgs: { start?: number; end?: number; }): dstore.FetchPromise; filter(query: string | {} | { (item: T, index: number): boolean; }): this; forEach(callback: (item: T, index: number) => void, thisObject?: any): dojo.promise.Promise; get(id: any): dojo.promise.Promise; getIdentity(object: T): any; on(eventName: string, listener: (event: dstore.ChangeEvent) => void): dojo.Handle; put(object: T, options?: {}): dojo.promise.Promise; remove(id: any): dojo.promise.Promise<{}>; sort(property: string | { (a: T, b: T): number; }, descending?: boolean): this; } module Store { export interface Constructor extends dojo._base.DeclareConstructor> { new (kwArgs?: Store.KwArgs): Store; } export interface KwArgs { idProperty?: typeof Store.prototype.idProperty; Model?: typeof Store.prototype.Model; } } const Store: Store.Constructor; export = Store; }