DefinitelyTyped/types/pathval/index.d.ts
Rebecca Turner 90298b1f8b [pathval] Add types for pathval (#37453)
* [pathval] Add types for pathval

* Clean up redundant interfaces, use UMD mod. syntax

Changes requested by @sandersn

- Don't override lint rules in tslint.json
- Use modern UMD module syntax
- Removed redundant namespaces
2019-08-08 10:07:45 -07:00

22 lines
737 B
TypeScript

// Type definitions for pathval 1.1
// Project: https://www.npmjs.com/package/pathval
// Definitions by: Rebecca Turner <https://github.com/9999years>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
export interface PathInfo {
parent: object;
name: string;
value?: any;
exists: boolean;
}
export type Property = string | symbol | number;
export function hasProperty(obj: object | undefined | null, name: Property): boolean;
export function getPathInfo(obj: object, path: string): PathInfo;
export function getPathValue(obj: object, path: string): object | undefined;
export function setPathValue(obj: object, path: string, val: any): object;
export as namespace pathval;