Skip to content

Commit

Permalink
2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
AFatNiBBa committed Oct 21, 2021
1 parent 4017fe8 commit d947d3a
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "internal-prop",
"version": "2.1.2",
"version": "2.1.3",
"description": "Gives access to native objects internal properties, such as proxy's [[Target]] and [[Handler]]",
"main": "src/main.js",
"scripts": {
Expand Down
45 changes: 45 additions & 0 deletions src/main.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

declare module "internal-prop" {
/**
* Promise possible statuses.
*/
export type Status = "fulfilled" | "pending" | "rejected";

/**
* Gets the [[Target]] and [[Handler]] of "obj".
* If "obj" is not a `Proxy` returns `null`.
* @param obj A `Proxy`
*/
export function fromProxy(obj: Proxy): [ object, object ];

/**
* Gets the value and status of "obj".
* If "obj" is not a `Promise` returns `null`.
* @param obj A `Proxy`
*/
export function fromPromise(obj: Promise): [ Status, any ];

/**
* Gets the keys of the private properties of "obj".
* If "obj" is not an `Object` returns `null`.
* @param obj A `Proxy`
*/
export function getOwnPrivateSymbols(obj: object): symbol[];

/**
* It returns an object through which you can access the private properties of "obj".
* @param obj The object of which you want to access the private properties
* @returns The inspector object
*/
export function privateAccess(obj: object): object;

/**
* A getter and a setter will be created on "bind" and they will be named "name", they will point to the "key" property of "obj".
* @param obj The object of which you want to access the private properties
* @param key The private symbol to access
* @param bind The object on which you want to mount the getters and setters
* @param name The name that will be given to the getter and setter
* @returns The inspector object
*/
export function privateAccess(obj: object, key: symbol, bind: object, name?: string | symbol): object;
}

0 comments on commit d947d3a

Please sign in to comment.