@basmilius/http-client 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,16 +3,16 @@ declare const _default: {
3
3
  * Trap for when a property is deleted from the target. This
4
4
  * will mark the parent dto as dirty and trigger an update.
5
5
  */
6
- deleteProperty(target: unknown[], key: string | symbol): boolean
6
+ deleteProperty(target: unknown[], key: string | symbol): boolean;
7
7
  /**
8
8
  * Trap for when a property of the target is being accessed. The
9
9
  * property access is being tracked for further updates.
10
10
  */
11
- get(target: unknown[], key: string | symbol, receiver: any): unknown
11
+ get(target: unknown[], key: string | symbol, receiver: any): unknown;
12
12
  /**
13
13
  * Trap for when a property of the target is being updated. This
14
14
  * will mark the parent dto as dirty and trigger an update.
15
15
  */
16
- set(target: unknown[], key: string | symbol, value: unknown, receiver: any)
16
+ set(target: unknown[], key: string | symbol, value: unknown, receiver: any);
17
17
  };
18
18
  export default _default;
@@ -6,6 +6,6 @@ declare const _default: {
6
6
  * to all arguments and a proxied custom ref is returned that references
7
7
  * the actual dto instance.
8
8
  */
9
- construct(target: Constructor, argsArray: any[], newTarget: Function): DtoInstance<unknown>
9
+ construct(target: Constructor, argsArray: any[], newTarget: Function): DtoInstance<unknown>;
10
10
  };
11
11
  export default _default;
@@ -1,2 +1,5 @@
1
1
  import type DtoInstance from "./instance";
2
+ /**
3
+ * Returns a clone of the dto.
4
+ */
2
5
  export default function<T>(this: DtoInstance<T>): DtoInstance<T>;
@@ -1,2 +1,5 @@
1
1
  import type DtoInstance from "./instance";
2
+ /**
3
+ * Fills the dto with the given data.
4
+ */
2
5
  export default function(this: DtoInstance<unknown>, data: Record<string, unknown>): void;
@@ -1 +1,5 @@
1
+ /**
2
+ * Checks if the two given values are equal. When both values are a
3
+ * dto, the check is done by firstly converthing them to JSON.
4
+ */
1
5
  export default function(a: unknown, b: unknown): boolean;
@@ -1,2 +1,5 @@
1
1
  import type DtoInstance from "../instance";
2
+ /**
3
+ * Asserts that the given object is a dto.
4
+ */
2
5
  export default function(obj: unknown): asserts obj is DtoInstance<never>;
@@ -1 +1,4 @@
1
+ /**
2
+ * Clones the given dto.
3
+ */
1
4
  export default function<T>(obj: T): T;
@@ -1,4 +1,7 @@
1
1
  import type DtoInstance from "../instance";
2
+ /**
3
+ * Executes the given function if the given dto is marked dirty.
4
+ */
2
5
  export default function<
3
6
  T,
4
7
  R = void
@@ -1,2 +1,5 @@
1
1
  import type DtoInstance from "../instance";
2
+ /**
3
+ * Checks if the given object is a dto.
4
+ */
2
5
  export default function(obj: unknown): obj is DtoInstance<unknown>;
@@ -1 +1,4 @@
1
+ /**
2
+ * Checks if the given dto is clean.
3
+ */
1
4
  export default function(obj: unknown): boolean;
@@ -1 +1,4 @@
1
+ /**
2
+ * Checks if the given dto is dirty.
3
+ */
1
4
  export default function(obj: unknown): boolean;
@@ -1,2 +1,5 @@
1
1
  import type DtoInstance from "../instance";
2
+ /**
3
+ * Creates a parent-child relationship between the given two dtos.
4
+ */
2
5
  export default function(dto: DtoInstance<unknown>, parent: DtoInstance<unknown>, key: string): void;
@@ -1,2 +1,5 @@
1
1
  import type DtoInstance from "../instance";
2
+ /**
3
+ * Creates relationships between the given value and dto.
4
+ */
2
5
  export default function(dto: DtoInstance<unknown>, key: string, value: unknown): void;
@@ -1,2 +1,5 @@
1
1
  import type DtoInstance from "../instance";
2
+ /**
3
+ * Tracking for when a dto property is being accessed.
4
+ */
2
5
  export default function trackDto(dto: DtoInstance<unknown>, key: string): void;
@@ -1,2 +1,5 @@
1
1
  import type DtoInstance from "../instance";
2
+ /**
3
+ * Removes a parent-child relationship between the given two dtos.
4
+ */
2
5
  export default function(dto: DtoInstance<unknown>, parent: DtoInstance<unknown>): void;
@@ -1,2 +1,5 @@
1
1
  import type DtoInstance from "../instance";
2
+ /**
3
+ * Removes relationships between the given value and dto.
4
+ */
2
5
  export default function(dto: DtoInstance<unknown>, value: unknown): void;
@@ -1,4 +1,7 @@
1
1
  import { type Constructor } from "@basmilius/utils";
2
2
  import type DtoInstance from "./instance";
3
+ /**
4
+ * Provides reactivity to the decorated class.
5
+ */
3
6
  export default function<T extends Constructor>(clazz: T): T;
4
7
  export type { DtoInstance };
@@ -5,20 +5,20 @@ declare const _default: {
5
5
  * access is being tracked for further updates. If the dto has
6
6
  * any child dtos, a relationship will be added between them.
7
7
  */
8
- get(target: DtoInstance<unknown>, key: string | symbol, receiver: any): unknown
8
+ get(target: DtoInstance<unknown>, key: string | symbol, receiver: any): unknown;
9
9
  /**
10
10
  * Trap for when a descriptor of a dto property is requested.
11
11
  */
12
- getOwnPropertyDescriptor(target: DtoInstance<unknown>, key: string | symbol): PropertyDescriptor | undefined
12
+ getOwnPropertyDescriptor(target: DtoInstance<unknown>, key: string | symbol): PropertyDescriptor | undefined;
13
13
  /**
14
14
  * Trap for when the keys of a dto are requested.
15
15
  */
16
- ownKeys(target: DtoInstance<unknown>)
16
+ ownKeys(target: DtoInstance<unknown>);
17
17
  /**
18
18
  * Trap for when a dto property is being updated. This will
19
19
  * mark the dto dirty and trigger an update. If an array is
20
20
  * passed, that array will be made reactive as well.
21
21
  */
22
- set(target: DtoInstance<unknown>, key: string | symbol, value: unknown, receiver: any): boolean
22
+ set(target: DtoInstance<unknown>, key: string | symbol, value: unknown, receiver: any): boolean;
23
23
  };
24
24
  export default _default;
@@ -11,23 +11,23 @@ declare const _default: {
11
11
  * of refs are used by our dto, but we don't want Vue to treat
12
12
  * it as a ref. We return false here to trick Vue.
13
13
  */
14
- get(target: Ref<DtoInstance<unknown>>, key: string | symbol, receiver: any): unknown
14
+ get(target: Ref<DtoInstance<unknown>>, key: string | symbol, receiver: any): unknown;
15
15
  /**
16
16
  * Trap for when a descriptor of a property is requested, that
17
17
  * request is proxied to the underlying dto.
18
18
  */
19
- getOwnPropertyDescriptor(target: Ref<DtoInstance<unknown>>, key: string | symbol): PropertyDescriptor | undefined
19
+ getOwnPropertyDescriptor(target: Ref<DtoInstance<unknown>>, key: string | symbol): PropertyDescriptor | undefined;
20
20
  /**
21
21
  * Trap for when the keys of the ref are requested, that request
22
22
  * is proxied to the underlying dto.
23
23
  */
24
- ownKeys(target: Ref<DtoInstance<unknown>>)
24
+ ownKeys(target: Ref<DtoInstance<unknown>>);
25
25
  /**
26
26
  * Trap for when a ref property is being updated. If the property
27
27
  * is not part of {Ref}, the set is proxied to the underlying dto
28
28
  * instance. In that proxy, the dto will be marked dirty and an
29
29
  * update is triggered.
30
30
  */
31
- set(target: Ref<DtoInstance<unknown>>, key: string | symbol, value: unknown, receiver: any): boolean
31
+ set(target: Ref<DtoInstance<unknown>>, key: string | symbol, value: unknown, receiver: any): boolean;
32
32
  };
33
33
  export default _default;
@@ -1,2 +1,5 @@
1
1
  import type DtoInstance from "./instance";
2
+ /**
3
+ * Returns the json object representation of the dto.
4
+ */
2
5
  export default function(this: DtoInstance<unknown>): Record<string, unknown>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@basmilius/http-client",
3
3
  "description": "Http client for Vue projects.",
4
- "version": "2.3.0",
4
+ "version": "2.4.0",
5
5
  "license": "MIT",
6
6
  "funding": "https://github.com/sponsors/basmilius",
7
7
  "homepage": "https://github.com/basmilius/packages",
@@ -46,13 +46,13 @@
46
46
  },
47
47
  "sideEffects": false,
48
48
  "devDependencies": {
49
- "@basmilius/utils": "2.3.0",
49
+ "@basmilius/utils": "2.4.0",
50
50
  "@types/luxon": "^3.6.2",
51
51
  "luxon": "^3.6.1",
52
- "vue": "^3.5.14"
52
+ "vue": "^3.5.17"
53
53
  },
54
54
  "peerDependencies": {
55
- "@basmilius/utils": "2.3.0",
55
+ "@basmilius/utils": "2.4.0",
56
56
  "luxon": "^3.6.1",
57
57
  "vue": "^3.5.13"
58
58
  }