jsonpointer.d.ts 666 B

1234567891011121314151617181920212223242526272829303132333435
  1. interface JSONPointer {
  2. /**
  3. * Looks up a JSON pointer in an object
  4. */
  5. get(object: Object): any;
  6. /**
  7. * Set a value for a JSON pointer on object
  8. */
  9. set(object: Object, value: any): void;
  10. }
  11. declare namespace JSONPointer {
  12. /**
  13. * Looks up a JSON pointer in an object
  14. */
  15. function get(object: Object, pointer: string): any;
  16. /**
  17. * Set a value for a JSON pointer on object
  18. */
  19. function set(object: Object, pointer: string, value: any): void;
  20. /**
  21. * Builds a JSONPointer instance from a pointer value.
  22. */
  23. function compile(pointer: string): JSONPointer;
  24. }
  25. export = JSONPointer;