Skip to content

Commit cb517c8

Browse files
authored
Merge pull request #30 from KeeReal/add-typings
typings added
2 parents bd34d88 + 8ba4ad9 commit cb517c8

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

jsonpointer.d.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
interface JSONPointer {
2+
/**
3+
* Looks up a JSON pointer in an object
4+
*/
5+
get(object: Object, pointer: string): any;
6+
7+
8+
/**
9+
* Set a value for a JSON pointer on object
10+
*/
11+
set(object: Object, pointer: string, value: any): void;
12+
}
13+
14+
15+
declare namespace JSONPointer {
16+
/**
17+
* Looks up a JSON pointer in an object
18+
*/
19+
function get(object: Object, pointer: string): any;
20+
21+
22+
/**
23+
* Set a value for a JSON pointer on object
24+
*/
25+
function set(object: Object, pointer: string, value: any): void;
26+
27+
28+
/**
29+
* Builds a JSONPointer instance from a pointer value.
30+
*/
31+
function compile(pointer: string): JSONPointer;
32+
}
33+
34+
35+
export = JSONPointer;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"node": ">=0.10.0"
2525
},
2626
"main": "./jsonpointer",
27+
"typings": "jsonpointer.d.ts",
2728
"files": [
2829
"jsonpointer.js"
2930
],

0 commit comments

Comments
 (0)