diff --git a/object-path/object-path.d.ts b/object-path/object-path.d.ts index b1e10cf877..dd9137610f 100644 --- a/object-path/object-path.d.ts +++ b/object-path/object-path.d.ts @@ -7,8 +7,8 @@ declare var objectPath: ObjectPathGlobal.IObjectPathStatic; declare module ObjectPathGlobal { - var Path: Array|number|string; - var multiArray: Array; + type IPath = Array|number|string; + type IMultiArray = Array; interface IObjectPathStatic { /** @@ -24,7 +24,7 @@ declare module ObjectPathGlobal { * @param {string[]|string} path * @return object */ - del(object: T, path: typeof Path): T; + del(object: T, path: IPath): T; /** * @see objectPath.del */ @@ -41,7 +41,7 @@ declare module ObjectPathGlobal { * @param {string[]|string} path * @return object */ - has(object: T, path: typeof Path): boolean; + has(object: T, path: IPath): boolean; /** * @see objectPath.has */ @@ -58,7 +58,7 @@ declare module ObjectPathGlobal { * @param {string|string[]|number|number[]} path * @param {*} [defaultValue=undefined] */ - get(object: T, path: typeof Path, defaultValue?: TResult): TResult; + get(object: T, path: IPath, defaultValue?: TResult): TResult; /** * @see objectPath.get */ @@ -77,7 +77,7 @@ declare module ObjectPathGlobal { * @param {boolean} [doNotReplace=false] * @return Any existing value on the path if any */ - set(object: T, path: typeof Path, value: any, doNotReplace?:boolean): TExisting; + set(object: T, path: IPath, value: any, doNotReplace?:boolean): TExisting; /** * @see objectPath.set */ @@ -92,7 +92,7 @@ declare module ObjectPathGlobal { * Create (if path isn't an array) and push the value to it. Can push unlimited number of values * @param {object} object */ - push(object: T, path: typeof Path, ...args:any[]):void; + push(object: T, path: IPath, ...args:any[]):void; /** * @see objectPath.push */ @@ -106,7 +106,7 @@ declare module ObjectPathGlobal { * @param {*} defaultValue * @return {*} */ - coalesce(object: T, paths: typeof multiArray, defaultValue?: TResult):TResult; + coalesce(object: T, paths: IMultiArray, defaultValue?: TResult):TResult; /*======== Empty =========*/ /** @@ -115,7 +115,7 @@ declare module ObjectPathGlobal { * @param {object} object * @param {string|string[]|number[]} path */ - empty(object: T, path: typeof Path):TResult; + empty(object: T, path: IPath):TResult; /** * @see objectPath.empty */ @@ -131,7 +131,7 @@ declare module ObjectPathGlobal { * @param {object} object * @param {string|string[]|number|number[]} path */ - ensureExists(object: T, path: typeof Path, value: any):TExisting; + ensureExists(object: T, path: IPath, value: any):TExisting; /** * @see objectPath.ensureExists */ @@ -149,7 +149,7 @@ declare module ObjectPathGlobal { * @param {*} value * @param {number} [at=0] */ - insert(object: T, path: typeof Path, value: any, at?: number):void; + insert(object: T, path: IPath, value: any, at?: number):void; } interface IObjectPathBound { @@ -158,7 +158,7 @@ declare module ObjectPathGlobal { /** * @see objectPath.ensureExists */ - del(path: typeof Path): T; + del(path: IPath): T; /** * @see objectPath.del */ @@ -168,7 +168,7 @@ declare module ObjectPathGlobal { /** * @see objectPath.ensureExists */ - has(path: typeof Path): boolean; + has(path: IPath): boolean; /** * @see objectPath.has */ @@ -178,7 +178,7 @@ declare module ObjectPathGlobal { /** * @see objectPath.ensureExists */ - get(path: typeof Path, defaultValue?: TResult): TResult; + get(path: IPath, defaultValue?: TResult): TResult; /** * @see objectPath.get */ @@ -188,7 +188,7 @@ declare module ObjectPathGlobal { /** * @see objectPath.ensureExists */ - set(path: typeof Path, value: any, doNotReplace?:boolean): TExisting; + set(path: IPath, value: any, doNotReplace?:boolean): TExisting; /** * @see objectPath.set */ @@ -198,7 +198,7 @@ declare module ObjectPathGlobal { /** * @see objectPath.ensureExists */ - push(path: typeof Path, ...args:any[]):void; + push(path: IPath, ...args:any[]):void; /** * @see objectPath.push */ @@ -208,13 +208,13 @@ declare module ObjectPathGlobal { /** * @see objectPath.ensureExists */ - coalesce(paths: typeof multiArray, defaultValue?: TResult):TResult; + coalesce(paths: IMultiArray, defaultValue?: TResult):TResult; /*======== Empty =========*/ /** * @see objectPath.ensureExists */ - empty(path: typeof Path):T; + empty(path: IPath):T; /** * @see objectPath.empty */ @@ -224,7 +224,7 @@ declare module ObjectPathGlobal { /** * @see objectPath.ensureExists */ - ensureExists(path: typeof Path, value: any):TExisting; + ensureExists(path: IPath, value: any):TExisting; /** * @see objectPath.ensureExists */ @@ -234,7 +234,7 @@ declare module ObjectPathGlobal { /** * @see objectPath.insert */ - insert(path: typeof Path, value: any, at?: number):void; + insert(path: IPath, value: any, at?: number):void; } }