lib.d.ts中的typescript定义

时间:2014-03-20 19:06:21

标签: typescript

请参阅代码here

var IQuery = {
    idxName: 'session',
    //keyRange: window.IDBKeyRange.only('1')
    keyRange: IDBKeyRange.only('1')
};

为什么它无法识别IDBKeyRange

lib.d.ts中,我看到了这些定义。

interface IDBKeyRange {
    upper: any;
    upperOpen: boolean;
    lower: any;
    lowerOpen: boolean;
    bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange;
    only(value: any): IDBKeyRange;
    lowerBound(bound: any, open?: boolean): IDBKeyRange;
    upperBound(bound: any, open?: boolean): IDBKeyRange;
}
declare var IDBKeyRange: {
    prototype: IDBKeyRange;
    new (): IDBKeyRange;
}

1 个答案:

答案 0 :(得分:1)

这是lib.d.ts文件中的bug。你可以get an updated copy from the CodePlex site