@efffrida/il2cpp-bridge 0.0.19 → 0.0.21
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.
- package/dist/Assembly.d.ts +10 -0
- package/dist/Assembly.d.ts.map +1 -1
- package/dist/Assembly.js +11 -0
- package/dist/Assembly.js.map +1 -1
- package/dist/Class.d.ts +54 -4
- package/dist/Class.d.ts.map +1 -1
- package/dist/Class.js +54 -1
- package/dist/Class.js.map +1 -1
- package/dist/Equivalence.d.ts +37 -0
- package/dist/Equivalence.d.ts.map +1 -0
- package/dist/Equivalence.js +37 -0
- package/dist/Equivalence.js.map +1 -0
- package/dist/Extensions.d.ts +85 -0
- package/dist/Extensions.d.ts.map +1 -0
- package/dist/Extensions.js +177 -0
- package/dist/Extensions.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/Assembly.ts +19 -0
- package/src/Class.ts +222 -20
- package/src/Equivalence.ts +44 -0
- package/src/Extensions.ts +239 -0
- package/src/index.ts +12 -0
package/dist/Assembly.d.ts
CHANGED
|
@@ -16,6 +16,16 @@ export declare const assembly: (name: string) => Effect.Effect<Il2Cpp.Assembly,
|
|
|
16
16
|
* @category Assembly
|
|
17
17
|
*/
|
|
18
18
|
export declare const tryAssembly: (name: string) => Effect.Effect<Il2Cpp.Assembly, Cause.NoSuchElementException, never>;
|
|
19
|
+
/**
|
|
20
|
+
* @since 1.0.0
|
|
21
|
+
* @category Assembly
|
|
22
|
+
*/
|
|
23
|
+
export declare const assemblyCached: Effect.Effect<typeof assembly, never, never>;
|
|
24
|
+
/**
|
|
25
|
+
* @since 1.0.0
|
|
26
|
+
* @category Assembly
|
|
27
|
+
*/
|
|
28
|
+
export declare const tryAssemblyCached: Effect.Effect<typeof tryAssembly, never, never>;
|
|
19
29
|
/**
|
|
20
30
|
* @since 1.0.0
|
|
21
31
|
* @category Assembly
|
package/dist/Assembly.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Assembly.d.ts","sourceRoot":"","sources":["../src/Assembly.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,qBAAqB,CAAC;AAE7B,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Assembly.d.ts","sourceRoot":"","sources":["../src/Assembly.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,qBAAqB,CAAC;AAE7B,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAChC,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAI7D,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,QAAQ,EAAE,KAAK,EAAE,KAAK,CAGvE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,WAAW,EAAE,KAAK,EAAE,KAAK,CAG7E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAGnE,CAAC"}
|
package/dist/Assembly.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import "frida-il2cpp-bridge";
|
|
6
6
|
import * as Cause from "effect/Cause";
|
|
7
7
|
import * as Effect from "effect/Effect";
|
|
8
|
+
import * as Equivalence from "effect/Equivalence";
|
|
8
9
|
/**
|
|
9
10
|
* @since 1.0.0
|
|
10
11
|
* @category Assembly
|
|
@@ -18,6 +19,16 @@ export const tryAssembly = name => Effect.try({
|
|
|
18
19
|
try: () => Il2Cpp.domain.tryAssembly(name),
|
|
19
20
|
catch: () => new Cause.NoSuchElementException(`No assembly with name ${name}`)
|
|
20
21
|
}).pipe(Effect.flatMap(Effect.fromNullable));
|
|
22
|
+
/**
|
|
23
|
+
* @since 1.0.0
|
|
24
|
+
* @category Assembly
|
|
25
|
+
*/
|
|
26
|
+
export const assemblyCached = /*#__PURE__*/Effect.cachedFunction(assembly, Equivalence.string);
|
|
27
|
+
/**
|
|
28
|
+
* @since 1.0.0
|
|
29
|
+
* @category Assembly
|
|
30
|
+
*/
|
|
31
|
+
export const tryAssemblyCached = /*#__PURE__*/Effect.cachedFunction(tryAssembly, Equivalence.string);
|
|
21
32
|
/**
|
|
22
33
|
* @since 1.0.0
|
|
23
34
|
* @category Assembly
|
package/dist/Assembly.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Assembly.js","names":["Cause","Effect","assembly","name","sync","Il2Cpp","domain","tryAssembly","try","catch","NoSuchElementException","pipe","flatMap","fromNullable","attach","acquireRelease","thread","detach"],"sources":["../src/Assembly.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;AAKA,OAAO,qBAAqB;AAI5B,OAAO,KAAKA,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,eAAe;
|
|
1
|
+
{"version":3,"file":"Assembly.js","names":["Cause","Effect","Equivalence","assembly","name","sync","Il2Cpp","domain","tryAssembly","try","catch","NoSuchElementException","pipe","flatMap","fromNullable","assemblyCached","cachedFunction","string","tryAssemblyCached","attach","acquireRelease","thread","detach"],"sources":["../src/Assembly.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;AAKA,OAAO,qBAAqB;AAI5B,OAAO,KAAKA,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,WAAW,MAAM,oBAAoB;AAEjD;;;;AAIA,OAAO,MAAMC,QAAQ,GAAIC,IAAY,IACjCH,MAAM,CAACI,IAAI,CAAC,MAAMC,MAAM,CAACC,MAAM,CAACJ,QAAQ,CAACC,IAAI,CAAC,CAAC;AAEnD;;;;AAIA,OAAO,MAAMI,WAAW,GAAIJ,IAAY,IACpCH,MAAM,CAACQ,GAAG,CAAC;EACPA,GAAG,EAAEA,CAAA,KAAMH,MAAM,CAACC,MAAM,CAACC,WAAW,CAACJ,IAAI,CAAC;EAC1CM,KAAK,EAAEA,CAAA,KAAM,IAAIV,KAAK,CAACW,sBAAsB,CAAC,yBAAyBP,IAAI,EAAE;CAChF,CAAC,CAACQ,IAAI,CAACX,MAAM,CAACY,OAAO,CAACZ,MAAM,CAACa,YAAY,CAAC,CAAC;AAEhD;;;;AAIA,OAAO,MAAMC,cAAc,gBAAiDd,MAAM,CAACe,cAAc,CAC7Fb,QAAQ,EACRD,WAAW,CAACe,MAAM,CACrB;AAED;;;;AAIA,OAAO,MAAMC,iBAAiB,gBAAoDjB,MAAM,CAACe,cAAc,CACnGR,WAAW,EACXN,WAAW,CAACe,MAAM,CACrB;AAED;;;;AAIA,OAAO,MAAME,MAAM,gBAAqDlB,MAAM,CAACmB,cAAc,cACzFnB,MAAM,CAACI,IAAI,CAAC,MAAMC,MAAM,CAACC,MAAM,CAACY,MAAM,EAAE,CAAC,EACxCE,MAAM,IAAKpB,MAAM,CAACI,IAAI,CAAC,MAAMgB,MAAM,CAACC,MAAM,EAAE,CAAC,CACjD","ignoreList":[]}
|
package/dist/Class.d.ts
CHANGED
|
@@ -25,22 +25,62 @@ export declare const tryClass: ((name: string) => (image: Il2Cpp.Image) => Effec
|
|
|
25
25
|
* @since 1.0.0
|
|
26
26
|
* @category Class
|
|
27
27
|
*/
|
|
28
|
-
export declare const
|
|
28
|
+
export declare const classCached: Effect.Effect<(image: Il2Cpp.Image, name: string) => Effect.Effect<Il2Cpp.Class, never, never>, never, never>;
|
|
29
29
|
/**
|
|
30
30
|
* @since 1.0.0
|
|
31
31
|
* @category Class
|
|
32
32
|
*/
|
|
33
|
-
export declare const
|
|
33
|
+
export declare const tryClassCached: Effect.Effect<(image: Il2Cpp.Image, name: string) => Effect.Effect<Il2Cpp.Class, Cause.NoSuchElementException, never>, never, never>;
|
|
34
34
|
/**
|
|
35
35
|
* @since 1.0.0
|
|
36
36
|
* @category Class
|
|
37
37
|
*/
|
|
38
|
-
export declare const
|
|
38
|
+
export declare const fields: (klass: Il2Cpp.Class) => Effect.Effect<ReadonlyArray<Il2Cpp.Field>, never, never>;
|
|
39
39
|
/**
|
|
40
40
|
* @since 1.0.0
|
|
41
41
|
* @category Class
|
|
42
42
|
*/
|
|
43
|
-
export declare const
|
|
43
|
+
export declare const field: ((name: string) => <T extends Il2Cpp.Field.Type = Il2Cpp.Field.Type>(klass: Il2Cpp.Class) => Effect.Effect<Il2Cpp.Field<T>, never, never>) & (<T extends Il2Cpp.Field.Type = Il2Cpp.Field.Type>(klass: Il2Cpp.Class, name: string) => Effect.Effect<Il2Cpp.Field<T>, never, never>);
|
|
44
|
+
/**
|
|
45
|
+
* @since 1.0.0
|
|
46
|
+
* @category Class
|
|
47
|
+
*/
|
|
48
|
+
export declare const tryField: ((name: string) => <T extends Il2Cpp.Field.Type = Il2Cpp.Field.Type>(klass: Il2Cpp.Class) => Effect.Effect<Il2Cpp.Field<T>, Cause.NoSuchElementException, never>) & (<T extends Il2Cpp.Field.Type = Il2Cpp.Field.Type>(klass: Il2Cpp.Class, name: string) => Effect.Effect<Il2Cpp.Field<T>, Cause.NoSuchElementException, never>);
|
|
49
|
+
/**
|
|
50
|
+
* @since 1.0.0
|
|
51
|
+
* @category Class
|
|
52
|
+
*/
|
|
53
|
+
export declare const fieldCached: Effect.Effect<(<T extends Il2Cpp.Field.Type = Il2Cpp.Field.Type>(klass: Il2Cpp.Class, name: string) => Effect.Effect<Il2Cpp.Field<T>, never, never>), never, never>;
|
|
54
|
+
/**
|
|
55
|
+
* @since 1.0.0
|
|
56
|
+
* @category Class
|
|
57
|
+
*/
|
|
58
|
+
export declare const tryFieldCached: Effect.Effect<(<T extends Il2Cpp.Field.Type = Il2Cpp.Field.Type>(klass: Il2Cpp.Class, name: string) => Effect.Effect<Il2Cpp.Field<T>, Cause.NoSuchElementException, never>), never, never>;
|
|
59
|
+
/**
|
|
60
|
+
* @since 1.0.0
|
|
61
|
+
* @category Class
|
|
62
|
+
*/
|
|
63
|
+
export declare const methods: (klass: Il2Cpp.Class) => Effect.Effect<ReadonlyArray<Il2Cpp.Method>, never, never>;
|
|
64
|
+
/**
|
|
65
|
+
* @since 1.0.0
|
|
66
|
+
* @category Class
|
|
67
|
+
*/
|
|
68
|
+
export declare const method: ((name: string, parameterCount?: number | undefined) => <T extends Il2Cpp.Method.ReturnType = Il2Cpp.Method.ReturnType>(klass: Il2Cpp.Class) => Effect.Effect<Il2Cpp.Method<T>, never, never>) & (<T extends Il2Cpp.Method.ReturnType = Il2Cpp.Method.ReturnType>(klass: Il2Cpp.Class, name: string, parameterCount?: number | undefined) => Effect.Effect<Il2Cpp.Method<T>, never, never>);
|
|
69
|
+
/**
|
|
70
|
+
* @since 1.0.0
|
|
71
|
+
* @category Class
|
|
72
|
+
*/
|
|
73
|
+
export declare const tryMethod: ((name: string, parameterCount?: number | undefined) => <T extends Il2Cpp.Method.ReturnType = Il2Cpp.Method.ReturnType>(klass: Il2Cpp.Class) => Effect.Effect<Il2Cpp.Method<T>, Cause.NoSuchElementException, never>) & (<T extends Il2Cpp.Method.ReturnType = Il2Cpp.Method.ReturnType>(klass: Il2Cpp.Class, name: string, parameterCount?: number | undefined) => Effect.Effect<Il2Cpp.Method<T>, Cause.NoSuchElementException, never>);
|
|
74
|
+
/**
|
|
75
|
+
* @since 1.0.0
|
|
76
|
+
* @category Class
|
|
77
|
+
*/
|
|
78
|
+
export declare const methodCached: Effect.Effect<(<T extends Il2Cpp.Method.ReturnType = Il2Cpp.Method.ReturnType>(klass: Il2Cpp.Class, name: string, parameterCount?: number | undefined) => Effect.Effect<Il2Cpp.Method<T>, never, never>), never, never>;
|
|
79
|
+
/**
|
|
80
|
+
* @since 1.0.0
|
|
81
|
+
* @category Class
|
|
82
|
+
*/
|
|
83
|
+
export declare const tryMethodCached: Effect.Effect<(<T extends Il2Cpp.Method.ReturnType = Il2Cpp.Method.ReturnType>(klass: Il2Cpp.Class, name: string, parameterCount?: number | undefined) => Effect.Effect<Il2Cpp.Method<T>, Cause.NoSuchElementException, never>), never, never>;
|
|
44
84
|
/**
|
|
45
85
|
* @since 1.0.0
|
|
46
86
|
* @category Class
|
|
@@ -51,4 +91,14 @@ export declare const nested: ((name: string) => (klass: Il2Cpp.Class) => Effect.
|
|
|
51
91
|
* @category Class
|
|
52
92
|
*/
|
|
53
93
|
export declare const tryNested: ((name: string) => (klass: Il2Cpp.Class) => Effect.Effect<Il2Cpp.Class, Cause.NoSuchElementException, never>) & ((klass: Il2Cpp.Class, name: string) => Effect.Effect<Il2Cpp.Class, Cause.NoSuchElementException, never>);
|
|
94
|
+
/**
|
|
95
|
+
* @since 1.0.0
|
|
96
|
+
* @category Class
|
|
97
|
+
*/
|
|
98
|
+
export declare const nestedCached: Effect.Effect<(klass: Il2Cpp.Class, name: string) => Effect.Effect<Il2Cpp.Class, never, never>, never, never>;
|
|
99
|
+
/**
|
|
100
|
+
* @since 1.0.0
|
|
101
|
+
* @category Class
|
|
102
|
+
*/
|
|
103
|
+
export declare const tryNestedCached: Effect.Effect<(klass: Il2Cpp.Class, name: string) => Effect.Effect<Il2Cpp.Class, Cause.NoSuchElementException, never>, never, never>;
|
|
54
104
|
//# sourceMappingURL=Class.d.ts.map
|
package/dist/Class.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Class.d.ts","sourceRoot":"","sources":["../src/Class.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,qBAAqB,CAAC;AAE7B,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Class.d.ts","sourceRoot":"","sources":["../src/Class.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,qBAAqB,CAAC;AAE7B,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAOxC;;;GAGG;AACH,QAAA,MAAM,MAAM,UACD,MAAM,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,aAC5E,MAAM,CAAC,KAAK,QAAQ,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CACH,CAAC;AAElF,OAAO;AACH;;;GAGG;AACH,MAAM,IAAI,KAAK,GAClB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,UACV,MAAM,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,aACnG,MAAM,CAAC,KAAK,QAAQ,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAM1G,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,CACnC,C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Y,EAAE,MAAM,CAAC,MAAM,CACpC,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAChF,KAAK,EACL,KAAK,CAIR,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,CACvC,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,EACvG,KAAK,EACL,KAAK,CAIR,CAAC"}
|
package/dist/Class.js
CHANGED
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
import "frida-il2cpp-bridge";
|
|
6
6
|
import * as Cause from "effect/Cause";
|
|
7
7
|
import * as Effect from "effect/Effect";
|
|
8
|
+
import * as Equivalence from "effect/Equivalence";
|
|
8
9
|
import * as Function from "effect/Function";
|
|
10
|
+
import * as Tuple from "effect/Tuple";
|
|
11
|
+
import * as Il2CppEquivalence from "./Equivalence.js";
|
|
9
12
|
/**
|
|
10
13
|
* @since 1.0.0
|
|
11
14
|
* @category Class
|
|
@@ -25,6 +28,21 @@ export const tryClass = /*#__PURE__*/Function.dual(2, (image, name) => Effect.tr
|
|
|
25
28
|
try: () => image.tryClass(name),
|
|
26
29
|
catch: () => new Cause.NoSuchElementException(`No class with name ${name}`)
|
|
27
30
|
}).pipe(Effect.flatMap(Effect.fromNullable)));
|
|
31
|
+
/**
|
|
32
|
+
* @since 1.0.0
|
|
33
|
+
* @category Class
|
|
34
|
+
*/
|
|
35
|
+
export const classCached = /*#__PURE__*/Effect.map(/*#__PURE__*/Effect.cachedFunction(/*#__PURE__*/Function.tupled(class_), /*#__PURE__*/Equivalence.tuple(Il2CppEquivalence.image, Equivalence.string)), Function.untupled);
|
|
36
|
+
/**
|
|
37
|
+
* @since 1.0.0
|
|
38
|
+
* @category Class
|
|
39
|
+
*/
|
|
40
|
+
export const tryClassCached = /*#__PURE__*/Effect.map(/*#__PURE__*/Effect.cachedFunction(/*#__PURE__*/Function.tupled(tryClass), /*#__PURE__*/Equivalence.tuple(Il2CppEquivalence.image, Equivalence.string)), Function.untupled);
|
|
41
|
+
/**
|
|
42
|
+
* @since 1.0.0
|
|
43
|
+
* @category Class
|
|
44
|
+
*/
|
|
45
|
+
export const fields = klass => Effect.sync(() => klass.fields);
|
|
28
46
|
/**
|
|
29
47
|
* @since 1.0.0
|
|
30
48
|
* @category Class
|
|
@@ -35,9 +53,24 @@ export const field = /*#__PURE__*/Function.dual(2, (klass, name) => Effect.sync(
|
|
|
35
53
|
* @category Class
|
|
36
54
|
*/
|
|
37
55
|
export const tryField = /*#__PURE__*/Function.dual(2, (klass, name) => Effect.try({
|
|
38
|
-
try: () => klass.
|
|
56
|
+
try: () => klass.field(name),
|
|
39
57
|
catch: () => new Cause.NoSuchElementException(`No field with name ${name}`)
|
|
40
58
|
}).pipe(Effect.flatMap(Effect.fromNullable)));
|
|
59
|
+
/**
|
|
60
|
+
* @since 1.0.0
|
|
61
|
+
* @category Class
|
|
62
|
+
*/
|
|
63
|
+
export const fieldCached = /*#__PURE__*/Effect.map(/*#__PURE__*/Effect.cachedFunction(/*#__PURE__*/Function.tupled(field), /*#__PURE__*/Equivalence.tuple(Il2CppEquivalence.class, Equivalence.string)), tupled => Function.untupled(tupled));
|
|
64
|
+
/**
|
|
65
|
+
* @since 1.0.0
|
|
66
|
+
* @category Class
|
|
67
|
+
*/
|
|
68
|
+
export const tryFieldCached = /*#__PURE__*/Effect.map(/*#__PURE__*/Effect.cachedFunction(/*#__PURE__*/Function.tupled(tryField), /*#__PURE__*/Equivalence.tuple(Il2CppEquivalence.class, Equivalence.string)), tupled => Function.untupled(tupled));
|
|
69
|
+
/**
|
|
70
|
+
* @since 1.0.0
|
|
71
|
+
* @category Class
|
|
72
|
+
*/
|
|
73
|
+
export const methods = klass => Effect.sync(() => klass.methods);
|
|
41
74
|
/**
|
|
42
75
|
* @since 1.0.0
|
|
43
76
|
* @category Class
|
|
@@ -51,6 +84,16 @@ export const tryMethod = /*#__PURE__*/Function.dual(_arguments => typeof _argume
|
|
|
51
84
|
try: () => klass.tryMethod(name, parameterCount),
|
|
52
85
|
catch: () => new Cause.NoSuchElementException(`No method with name ${name}`)
|
|
53
86
|
}).pipe(Effect.flatMap(Effect.fromNullable)));
|
|
87
|
+
/**
|
|
88
|
+
* @since 1.0.0
|
|
89
|
+
* @category Class
|
|
90
|
+
*/
|
|
91
|
+
export const methodCached = /*#__PURE__*/Effect.map(/*#__PURE__*/Effect.cachedFunction(/*#__PURE__*/Function.tupled(method), /*#__PURE__*/Equivalence.mapInput(/*#__PURE__*/Equivalence.tuple(Il2CppEquivalence.class, Equivalence.string, /*#__PURE__*/Equivalence.strict()), tuple => Tuple.make(tuple[0], tuple[1], tuple[2] ?? undefined))), tupled => Function.untupled(tupled));
|
|
92
|
+
/**
|
|
93
|
+
* @since 1.0.0
|
|
94
|
+
* @category Class
|
|
95
|
+
*/
|
|
96
|
+
export const tryMethodCached = /*#__PURE__*/Effect.map(/*#__PURE__*/Effect.cachedFunction(/*#__PURE__*/Function.tupled(tryMethod), /*#__PURE__*/Equivalence.mapInput(/*#__PURE__*/Equivalence.tuple(Il2CppEquivalence.class, Equivalence.string, /*#__PURE__*/Equivalence.strict()), tuple => Tuple.make(tuple[0], tuple[1], tuple[2] ?? undefined))), tupled => Function.untupled(tupled));
|
|
54
97
|
/**
|
|
55
98
|
* @since 1.0.0
|
|
56
99
|
* @category Class
|
|
@@ -64,4 +107,14 @@ export const tryNested = /*#__PURE__*/Function.dual(2, (klass, name) => Effect.t
|
|
|
64
107
|
try: () => klass.tryNested(name),
|
|
65
108
|
catch: () => new Cause.NoSuchElementException(`No nested class with name ${name}`)
|
|
66
109
|
}).pipe(Effect.flatMap(Effect.fromNullable)));
|
|
110
|
+
/**
|
|
111
|
+
* @since 1.0.0
|
|
112
|
+
* @category Class
|
|
113
|
+
*/
|
|
114
|
+
export const nestedCached = /*#__PURE__*/Effect.map(/*#__PURE__*/Effect.cachedFunction(/*#__PURE__*/Function.tupled(nested), /*#__PURE__*/Equivalence.tuple(Il2CppEquivalence.class, Equivalence.string)), Function.untupled);
|
|
115
|
+
/**
|
|
116
|
+
* @since 1.0.0
|
|
117
|
+
* @category Class
|
|
118
|
+
*/
|
|
119
|
+
export const tryNestedCached = /*#__PURE__*/Effect.map(/*#__PURE__*/Effect.cachedFunction(/*#__PURE__*/Function.tupled(tryNested), /*#__PURE__*/Equivalence.tuple(Il2CppEquivalence.class, Equivalence.string)), Function.untupled);
|
|
67
120
|
//# sourceMappingURL=Class.js.map
|
package/dist/Class.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Class.js","names":["Cause","Effect","Function","class_","dual","image","name","sync","class","tryClass","try","catch","NoSuchElementException","pipe","flatMap","fromNullable","
|
|
1
|
+
{"version":3,"file":"Class.js","names":["Cause","Effect","Equivalence","Function","Tuple","Il2CppEquivalence","class_","dual","image","name","sync","class","tryClass","try","catch","NoSuchElementException","pipe","flatMap","fromNullable","classCached","map","cachedFunction","tupled","tuple","string","untupled","tryClassCached","fields","klass","field","tryField","fieldCached","tryFieldCached","methods","method","_arguments","parameterCount","tryMethod","methodCached","mapInput","strict","make","undefined","tryMethodCached","nested","tryNested","nestedCached","tryNestedCached"],"sources":["../src/Class.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;AAKA,OAAO,qBAAqB;AAE5B,OAAO,KAAKA,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,WAAW,MAAM,oBAAoB;AACjD,OAAO,KAAKC,QAAQ,MAAM,iBAAiB;AAC3C,OAAO,KAAKC,KAAK,MAAM,cAAc;AAErC,OAAO,KAAKC,iBAAiB,MAAM,kBAAkB;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AM,CAACgB,OAAO,CAAChB,MAAM,CAACiB,YAAY,CAAC,CAAC,CAC/C;AAED;;;;AAIA,OAAO,MAAM4B,YAAY,gBAIrB7C,MAAM,CAACmB,GAAG,cACVnB,MAAM,CAACoB,cAAc,cAAClB,QAAQ,CAACmB,MAAM,CAACsB,MAAM,CAAC,eAAE1C,WAAW,CAACqB,KAAK,CAAClB,iBAAiB,CAACM,KAAK,EAAET,WAAW,CAACsB,MAAM,CAAC,CAAC,EAC9GrB,QAAQ,CAACsB,QAAQ,CACpB;AAED;;;;AAIA,OAAO,MAAMsB,eAAe,gBAIxB9C,MAAM,CAACmB,GAAG,cACVnB,MAAM,CAACoB,cAAc,cAAClB,QAAQ,CAACmB,MAAM,CAACuB,SAAS,CAAC,eAAE3C,WAAW,CAACqB,KAAK,CAAClB,iBAAiB,CAACM,KAAK,EAAET,WAAW,CAACsB,MAAM,CAAC,CAAC,EACjHrB,QAAQ,CAACsB,QAAQ,CACpB","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
* @category Equivalence
|
|
4
|
+
*/
|
|
5
|
+
import * as Equivalence from "effect/Equivalence";
|
|
6
|
+
/**
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
* @category Equivalence
|
|
9
|
+
*/
|
|
10
|
+
export declare const nativePointer: Equivalence.Equivalence<NativePointer>;
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
* @category Equivalence
|
|
14
|
+
*/
|
|
15
|
+
export declare const image: Equivalence.Equivalence<Il2Cpp.Image>;
|
|
16
|
+
/**
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
* @category Equivalence
|
|
19
|
+
*/
|
|
20
|
+
declare const class_: Equivalence.Equivalence<Il2Cpp.Class>;
|
|
21
|
+
export {
|
|
22
|
+
/**
|
|
23
|
+
* @since 1.0.0
|
|
24
|
+
* @category Equivalence
|
|
25
|
+
*/
|
|
26
|
+
class_ as class, };
|
|
27
|
+
/**
|
|
28
|
+
* @since 1.0.0
|
|
29
|
+
* @category Equivalence
|
|
30
|
+
*/
|
|
31
|
+
export declare const field: Equivalence.Equivalence<Il2Cpp.Field<Il2Cpp.Field.Type>>;
|
|
32
|
+
/**
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
* @category Equivalence
|
|
35
|
+
*/
|
|
36
|
+
export declare const method: Equivalence.Equivalence<Il2Cpp.Method<Il2Cpp.Method.ReturnType>>;
|
|
37
|
+
//# sourceMappingURL=Equivalence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Equivalence.d.ts","sourceRoot":"","sources":["../src/Equivalence.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,aAAa,wCAAqE,CAAC;AAEhG;;;GAGG;AACH,eAAO,MAAM,KAAK,uCAA6E,CAAC;AAEhG;;;GAGG;AACH,QAAA,MAAM,MAAM,uCAA6E,CAAC;AAE1F,OAAO;AACH;;;GAGG;AACH,MAAM,IAAI,KAAK,GAClB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,KAAK,0DAA6E,CAAC;AAEhG;;;GAGG;AACH,eAAO,MAAM,MAAM,kEAAgF,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
* @category Equivalence
|
|
4
|
+
*/
|
|
5
|
+
import * as Equivalence from "effect/Equivalence";
|
|
6
|
+
/**
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
* @category Equivalence
|
|
9
|
+
*/
|
|
10
|
+
export const nativePointer = /*#__PURE__*/Equivalence.make((self, that) => self.equals(that));
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
* @category Equivalence
|
|
14
|
+
*/
|
|
15
|
+
export const image = /*#__PURE__*/Equivalence.mapInput(nativePointer, image => image.handle);
|
|
16
|
+
/**
|
|
17
|
+
* @since 1.0.0
|
|
18
|
+
* @category Equivalence
|
|
19
|
+
*/
|
|
20
|
+
const class_ = /*#__PURE__*/Equivalence.mapInput(nativePointer, klass => klass.handle);
|
|
21
|
+
export {
|
|
22
|
+
/**
|
|
23
|
+
* @since 1.0.0
|
|
24
|
+
* @category Equivalence
|
|
25
|
+
*/
|
|
26
|
+
class_ as class };
|
|
27
|
+
/**
|
|
28
|
+
* @since 1.0.0
|
|
29
|
+
* @category Equivalence
|
|
30
|
+
*/
|
|
31
|
+
export const field = /*#__PURE__*/Equivalence.mapInput(nativePointer, field => field.handle);
|
|
32
|
+
/**
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
* @category Equivalence
|
|
35
|
+
*/
|
|
36
|
+
export const method = /*#__PURE__*/Equivalence.mapInput(nativePointer, method => method.handle);
|
|
37
|
+
//# sourceMappingURL=Equivalence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Equivalence.js","names":["Equivalence","nativePointer","make","self","that","equals","image","mapInput","handle","class_","klass","class","field","method"],"sources":["../src/Equivalence.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;AAKA,OAAO,KAAKA,WAAW,MAAM,oBAAoB;AAEjD;;;;AAIA,OAAO,MAAMC,aAAa,gBAAGD,WAAW,CAACE,IAAI,CAAgB,CAACC,IAAI,EAAEC,IAAI,KAAKD,IAAI,CAACE,MAAM,CAACD,IAAI,CAAC,CAAC;AAE/F;;;;AAIA,OAAO,MAAME,KAAK,gBAAGN,WAAW,CAACO,QAAQ,CAACN,aAAa,EAAGK,KAAmB,IAAKA,KAAK,CAACE,MAAM,CAAC;AAE/F;;;;AAIA,MAAMC,MAAM,gBAAGT,WAAW,CAACO,QAAQ,CAACN,aAAa,EAAGS,KAAmB,IAAKA,KAAK,CAACF,MAAM,CAAC;AAEzF;AACI;;;;AAIAC,MAAM,IAAIE,KAAK;AAGnB;;;;AAIA,OAAO,MAAMC,KAAK,gBAAGZ,WAAW,CAACO,QAAQ,CAACN,aAAa,EAAGW,KAAmB,IAAKA,KAAK,CAACJ,MAAM,CAAC;AAE/F;;;;AAIA,OAAO,MAAMK,MAAM,gBAAGb,WAAW,CAACO,QAAQ,CAACN,aAAa,EAAGY,MAAqB,IAAKA,MAAM,CAACL,MAAM,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
* @category Extensions
|
|
4
|
+
*/
|
|
5
|
+
import "frida-il2cpp-bridge";
|
|
6
|
+
/**
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
* @category Extensions
|
|
9
|
+
*/
|
|
10
|
+
export declare class Dictionary<K extends Il2Cpp.Field.Type = Il2Cpp.Field.Type, V extends Il2Cpp.Field.Type = Il2Cpp.Field.Type> extends Il2Cpp.Object {
|
|
11
|
+
/** Gets the pairs count of the current dictionary. */
|
|
12
|
+
get length(): number;
|
|
13
|
+
/** Gets all keys of the current dictionary. */
|
|
14
|
+
get keys(): Array<K>;
|
|
15
|
+
/** Gets all values of the current dictionary. */
|
|
16
|
+
get values(): Array<V>;
|
|
17
|
+
/** Gets all pairs of the current dictionary. */
|
|
18
|
+
get entries(): Array<[K, V]>;
|
|
19
|
+
/** Gets the value by the specified key of the current dictionary. */
|
|
20
|
+
get(key: K): V;
|
|
21
|
+
/** Sets the pair of the current dictionary. */
|
|
22
|
+
set(key: K, value: V): void;
|
|
23
|
+
/** Adds a new key to the current dictionary. */
|
|
24
|
+
add(key: K, value: V): void;
|
|
25
|
+
/** Clears the current dictionary. */
|
|
26
|
+
clear(): void;
|
|
27
|
+
/** Determines if the key is in the current dictionary. */
|
|
28
|
+
containsKey(key: K): boolean;
|
|
29
|
+
/** Determines if the value is in the current dictionary. */
|
|
30
|
+
containsValue(value: V): boolean;
|
|
31
|
+
/** Finds a key in the current dictionary and returns its index. */
|
|
32
|
+
find(key: K): number;
|
|
33
|
+
/** Removes the given key from the current dictionary. */
|
|
34
|
+
remove(key: K): boolean;
|
|
35
|
+
[Symbol.iterator](): IterableIterator<[K, V]>;
|
|
36
|
+
toString(): string;
|
|
37
|
+
toRecord(keys?: Array<K> | undefined): Record<string, V>;
|
|
38
|
+
/** The Dictionary class. */
|
|
39
|
+
static get class(): Il2Cpp.Class;
|
|
40
|
+
/** Lifts an Il2Cpp.Object to a Dictionary. */
|
|
41
|
+
static lift<K extends Il2Cpp.Field.Type = Il2Cpp.Field.Type, V extends Il2Cpp.Field.Type = Il2Cpp.Field.Type>(object: Il2Cpp.Object): Dictionary<K, V>;
|
|
42
|
+
/** Creates a new dictionary with the given elements. */
|
|
43
|
+
static of<K extends Il2Cpp.Field.Type = Il2Cpp.Field.Type, V extends Il2Cpp.Field.Type = Il2Cpp.Field.Type>(keyClass: Il2Cpp.Class, valueClass: Il2Cpp.Class, elements?: Map<K, V> | undefined): Dictionary<K, V>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @since 1.0.0
|
|
47
|
+
* @category Extensions
|
|
48
|
+
*/
|
|
49
|
+
export declare class List<T extends Il2Cpp.Field.Type = Il2Cpp.Field.Type> extends Il2Cpp.Object {
|
|
50
|
+
get capacity(): number;
|
|
51
|
+
set capacity(value: number);
|
|
52
|
+
/** Gets the element count of the current list. */
|
|
53
|
+
get length(): number;
|
|
54
|
+
/** Gets the value by the specified index of the current list. */
|
|
55
|
+
get(index: number): T;
|
|
56
|
+
/** Sets the element of the current list. */
|
|
57
|
+
set(index: number, value: T): void;
|
|
58
|
+
/** Adds a new element to the current list. */
|
|
59
|
+
add(item: T): void;
|
|
60
|
+
/** Clears the current list. */
|
|
61
|
+
clear(): void;
|
|
62
|
+
/** Determines if the key is in the current list. */
|
|
63
|
+
contains(item: T): boolean;
|
|
64
|
+
/** Determines the index of the element of the current list. */
|
|
65
|
+
indexOf(item: T): number;
|
|
66
|
+
/** Inserts an element at the given index of the current list. */
|
|
67
|
+
insert(index: number, item: T): void;
|
|
68
|
+
/** Removes a data element from the current list. */
|
|
69
|
+
remove(item: T): boolean;
|
|
70
|
+
/** Reverses the current list. */
|
|
71
|
+
reverse(): void;
|
|
72
|
+
/** Sorts the current list. */
|
|
73
|
+
sort(): void;
|
|
74
|
+
/** Converts the current list to an array. */
|
|
75
|
+
get toArray(): Il2Cpp.Array<T>;
|
|
76
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
77
|
+
toString(): string;
|
|
78
|
+
/** The List class. */
|
|
79
|
+
static get class(): Il2Cpp.Class;
|
|
80
|
+
/** Lifts an Il2Cpp.Array to a List. */
|
|
81
|
+
static lift<T extends Il2Cpp.Field.Type = Il2Cpp.Field.Type>(object: Il2Cpp.Object): List<T>;
|
|
82
|
+
/** Creates a new list with the given elements. */
|
|
83
|
+
static of<T extends Il2Cpp.Field.Type = Il2Cpp.Field.Type>(klass: Il2Cpp.Class, elements?: Array<T> | undefined): List<T>;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=Extensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Extensions.d.ts","sourceRoot":"","sources":["../src/Extensions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,qBAAqB,CAAC;AAI7B;;;GAGG;AACH,qBAAa,UAAU,CACnB,CAAC,SAAS,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAC/C,CAAC,SAAS,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAE/C,SAAQ,MAAM,CAAC,MAAM;IAErB,sDAAsD;IACtD,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED,+CAA+C;IAC/C,IAAW,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,CAI1B;IAED,iDAAiD;IACjD,IAAW,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,CAI5B;IAED,gDAAg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;IAInB,6CAA6C;IAC7C,IAAW,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAEpC;IAEO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,CAAC,CAAC;IAMhC,QAAQ,IAAI,MAAM;IAIlC,sBAAsB;IACtB,WAAkB,KAAK,iBAEtB;IAED,uCAAuC;WACzB,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAInG,kDAAkD;WACpC,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAC5D,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,GAAE,KAAK,CAAC,CAAC,CAAC,GAAG,SAAc,GACpC,IAAI,CAAC,CAAC,CAAC;CAQb"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
* @category Extensions
|
|
4
|
+
*/
|
|
5
|
+
import "frida-il2cpp-bridge";
|
|
6
|
+
import { Array, Option, Record } from "effect";
|
|
7
|
+
/**
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
* @category Extensions
|
|
10
|
+
*/
|
|
11
|
+
export class Dictionary extends Il2Cpp.Object {
|
|
12
|
+
/** Gets the pairs count of the current dictionary. */
|
|
13
|
+
get length() {
|
|
14
|
+
return this.method("get_Count").invoke();
|
|
15
|
+
}
|
|
16
|
+
/** Gets all keys of the current dictionary. */
|
|
17
|
+
get keys() {
|
|
18
|
+
const keys = Il2Cpp.array(this.class.generics[0], this.length);
|
|
19
|
+
this.method("get_Keys").invoke().method("CopyTo").invoke(keys, 0);
|
|
20
|
+
return Array.fromIterable(keys);
|
|
21
|
+
}
|
|
22
|
+
/** Gets all values of the current dictionary. */
|
|
23
|
+
get values() {
|
|
24
|
+
const values = Il2Cpp.array(this.class.generics[1], this.length);
|
|
25
|
+
this.method("get_Values").invoke().method("CopyTo").invoke(values, 0);
|
|
26
|
+
return Array.fromIterable(values);
|
|
27
|
+
}
|
|
28
|
+
/** Gets all pairs of the current dictionary. */
|
|
29
|
+
get entries() {
|
|
30
|
+
return Array.zip(this.keys, this.values);
|
|
31
|
+
}
|
|
32
|
+
/** Gets the value by the specified key of the current dictionary. */
|
|
33
|
+
get(key) {
|
|
34
|
+
return this.method("get_Item").invoke(key);
|
|
35
|
+
}
|
|
36
|
+
/** Sets the pair of the current dictionary. */
|
|
37
|
+
set(key, value) {
|
|
38
|
+
this.method("set_Item").invoke(key, value);
|
|
39
|
+
}
|
|
40
|
+
/** Adds a new key to the current dictionary. */
|
|
41
|
+
add(key, value) {
|
|
42
|
+
this.method("Add").invoke(key, value);
|
|
43
|
+
}
|
|
44
|
+
/** Clears the current dictionary. */
|
|
45
|
+
clear() {
|
|
46
|
+
this.method("Clear").invoke();
|
|
47
|
+
}
|
|
48
|
+
/** Determines if the key is in the current dictionary. */
|
|
49
|
+
containsKey(key) {
|
|
50
|
+
return this.method("ContainsKey").invoke(key);
|
|
51
|
+
}
|
|
52
|
+
/** Determines if the value is in the current dictionary. */
|
|
53
|
+
containsValue(value) {
|
|
54
|
+
return this.method("ContainsValue").invoke(value);
|
|
55
|
+
}
|
|
56
|
+
/** Finds a key in the current dictionary and returns its index. */
|
|
57
|
+
find(key) {
|
|
58
|
+
return this.method("FindEntry").invoke(key);
|
|
59
|
+
}
|
|
60
|
+
/** Removes the given key from the current dictionary. */
|
|
61
|
+
remove(key) {
|
|
62
|
+
return this.method("Remove").invoke(key);
|
|
63
|
+
}
|
|
64
|
+
*[Symbol.iterator]() {
|
|
65
|
+
const entries = this.entries;
|
|
66
|
+
for (let i = 0; i < this.length; i++) {
|
|
67
|
+
yield entries[i];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
toString() {
|
|
71
|
+
return this.isNull() ? "null" : `{${[...this.entries].map(([k, v]) => `${k}: ${v}`).join(", ")}}`;
|
|
72
|
+
}
|
|
73
|
+
toRecord(keys) {
|
|
74
|
+
return Record.fromEntries(Array.filterMap(keys ?? this.keys, key => Option.product(key instanceof Il2Cpp.String ? Option.fromNullable(key.content) : Option.some(key.toString()), this.containsKey(key) ? Option.some(this.get(key)) : Option.none())));
|
|
75
|
+
}
|
|
76
|
+
/** The Dictionary class. */
|
|
77
|
+
static get class() {
|
|
78
|
+
return Il2Cpp.corlib.class("System.Collections.Generic.Dictionary`2");
|
|
79
|
+
}
|
|
80
|
+
/** Lifts an Il2Cpp.Object to a Dictionary. */
|
|
81
|
+
static lift(object) {
|
|
82
|
+
return new Dictionary(object.handle);
|
|
83
|
+
}
|
|
84
|
+
/** Creates a new dictionary with the given elements. */
|
|
85
|
+
static of(keyClass, valueClass, elements) {
|
|
86
|
+
const dictionary = new Dictionary(Dictionary.class.inflate(keyClass, valueClass).alloc());
|
|
87
|
+
for (const [key, value] of elements ?? []) {
|
|
88
|
+
dictionary.set(key, value);
|
|
89
|
+
}
|
|
90
|
+
return dictionary;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* @since 1.0.0
|
|
95
|
+
* @category Extensions
|
|
96
|
+
*/
|
|
97
|
+
export class List extends Il2Cpp.Object {
|
|
98
|
+
get capacity() {
|
|
99
|
+
return this.method("get_Capacity").invoke();
|
|
100
|
+
}
|
|
101
|
+
set capacity(value) {
|
|
102
|
+
this.method("set_Capacity").invoke(value);
|
|
103
|
+
}
|
|
104
|
+
/** Gets the element count of the current list. */
|
|
105
|
+
get length() {
|
|
106
|
+
return this.method("get_Count").invoke();
|
|
107
|
+
}
|
|
108
|
+
/** Gets the value by the specified index of the current list. */
|
|
109
|
+
get(index) {
|
|
110
|
+
return this.method("get_Item").invoke(index);
|
|
111
|
+
}
|
|
112
|
+
/** Sets the element of the current list. */
|
|
113
|
+
set(index, value) {
|
|
114
|
+
this.method("set_Item").invoke(index, value);
|
|
115
|
+
}
|
|
116
|
+
/** Adds a new element to the current list. */
|
|
117
|
+
add(item) {
|
|
118
|
+
this.method("Add").invoke(item);
|
|
119
|
+
}
|
|
120
|
+
/** Clears the current list. */
|
|
121
|
+
clear() {
|
|
122
|
+
this.method("Clear").invoke();
|
|
123
|
+
}
|
|
124
|
+
/** Determines if the key is in the current list. */
|
|
125
|
+
contains(item) {
|
|
126
|
+
return this.method("Contains").invoke(item);
|
|
127
|
+
}
|
|
128
|
+
/** Determines the index of the element of the current list. */
|
|
129
|
+
indexOf(item) {
|
|
130
|
+
return this.method("IndexOf").invoke(item);
|
|
131
|
+
}
|
|
132
|
+
/** Inserts an element at the given index of the current list. */
|
|
133
|
+
insert(index, item) {
|
|
134
|
+
this.method("Insert").invoke(index, item);
|
|
135
|
+
}
|
|
136
|
+
/** Removes a data element from the current list. */
|
|
137
|
+
remove(item) {
|
|
138
|
+
return this.method("Remove").invoke(item);
|
|
139
|
+
}
|
|
140
|
+
/** Reverses the current list. */
|
|
141
|
+
reverse() {
|
|
142
|
+
this.method("Reverse").invoke();
|
|
143
|
+
}
|
|
144
|
+
/** Sorts the current list. */
|
|
145
|
+
sort() {
|
|
146
|
+
this.method("Sort").invoke();
|
|
147
|
+
}
|
|
148
|
+
/** Converts the current list to an array. */
|
|
149
|
+
get toArray() {
|
|
150
|
+
return this.method("ToArray").invoke();
|
|
151
|
+
}
|
|
152
|
+
*[Symbol.iterator]() {
|
|
153
|
+
for (let i = 0; i < this.length; i++) {
|
|
154
|
+
yield this.get(i);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
toString() {
|
|
158
|
+
return this.toArray.toString();
|
|
159
|
+
}
|
|
160
|
+
/** The List class. */
|
|
161
|
+
static get class() {
|
|
162
|
+
return Il2Cpp.corlib.class("System.Collections.Generic.List`1");
|
|
163
|
+
}
|
|
164
|
+
/** Lifts an Il2Cpp.Array to a List. */
|
|
165
|
+
static lift(object) {
|
|
166
|
+
return new List(object.handle);
|
|
167
|
+
}
|
|
168
|
+
/** Creates a new list with the given elements. */
|
|
169
|
+
static of(klass, elements = []) {
|
|
170
|
+
const list = new List(List.class.inflate(klass).alloc());
|
|
171
|
+
for (const element of elements) {
|
|
172
|
+
list.add(element);
|
|
173
|
+
}
|
|
174
|
+
return list;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=Extensions.js.map
|