@deafwave/osrs-botmaker-types 0.5.21 → 0.6.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.
@@ -0,0 +1 @@
1
+ /// <reference path="./okhttp3/okhttp3.d.ts" />
@@ -0,0 +1,60 @@
1
+ declare namespace Packages.okhttp3 {
2
+ class OkHttpClient {
3
+ constructor();
4
+ static Builder: typeof OkHttpClientBuilder;
5
+ newCall(request: Request): Call;
6
+ }
7
+
8
+ class OkHttpClientBuilder {
9
+ constructor();
10
+ connectTimeout(timeout: number, unit: java.util.concurrent.TimeUnit): OkHttpClientBuilder;
11
+ readTimeout(timeout: number, unit: java.util.concurrent.TimeUnit): OkHttpClientBuilder;
12
+ writeTimeout(timeout: number, unit: java.util.concurrent.TimeUnit): OkHttpClientBuilder;
13
+ build(): OkHttpClient;
14
+ }
15
+
16
+ class Request {
17
+ static Builder: typeof RequestBuilder;
18
+ }
19
+
20
+ class RequestBuilder {
21
+ constructor();
22
+ url(url: string): RequestBuilder;
23
+ addHeader(name: string, value: string): RequestBuilder;
24
+ get(): RequestBuilder;
25
+ post(body: RequestBody): RequestBuilder;
26
+ put(body: RequestBody): RequestBuilder;
27
+ patch(body: RequestBody): RequestBuilder;
28
+ delete(): RequestBuilder;
29
+ method(method: string, body: RequestBody): RequestBuilder;
30
+ build(): Request;
31
+ }
32
+
33
+ class RequestBody {
34
+ static create(mediaType: MediaType, content: string): RequestBody;
35
+ }
36
+
37
+ class MediaType {
38
+ static parse(mediaType: string): MediaType;
39
+ }
40
+
41
+ class Call {
42
+ execute(): Response;
43
+ }
44
+
45
+ class Response {
46
+ code(): number;
47
+ body(): ResponseBody | null;
48
+ headers(): Headers;
49
+ close(): void;
50
+ }
51
+
52
+ class ResponseBody {
53
+ string(): string;
54
+ }
55
+
56
+ class Headers {
57
+ names(): java.util.Set<string>;
58
+ get(name: string): string;
59
+ }
60
+ }
@@ -2,3 +2,4 @@
2
2
  /// <reference path="./runelite/index.d.ts" />
3
3
  /// <reference path="./sox/index.d.ts" />
4
4
  /// <reference path="./rhino/index.d.ts" />
5
+ /// <reference path="./Packages/index.d.ts" />
@@ -32,6 +32,7 @@
32
32
  /// <reference path="./swing/event/ListSelectionListener.d.ts" />
33
33
  /// <reference path="./util/index.d.ts" />
34
34
  /// <reference path="./util/Collection.d.ts" />
35
+ /// <reference path="./util/concurrent.d.ts" />
35
36
  /// <reference path="./io/FileWriter.d.ts" />
36
37
  /// <reference path="./swing/Border.d.ts" />
37
38
  /// <reference path="./swing/BorderFactory.d.ts" />
@@ -95,4 +96,6 @@
95
96
  /// <reference path="./awt/datatransfer/Transferable.d.ts" />
96
97
  /// <reference path="./awt/datatransfer/DataFlavor.d.ts" />
97
98
  /// <reference path="./awt/datatransfer/StringSelection.d.ts" />
99
+ /// <reference path="./security/MessageDigest.d.ts" />
100
+ /// <reference path="./security/MessageDigester.d.ts" />
98
101
  /* /// <reference path="./Java.d.ts" />*/
@@ -1,5 +1,74 @@
1
1
  declare namespace java.lang {
2
2
  export class String {
3
+ constructor(value?: string);
4
+
5
+ /**
6
+ * Converts this string to a new character array.
7
+ * @returns A newly allocated character array whose length is the length of this string and whose contents are initialized to contain the character sequence represented by this string.
8
+ */
3
9
  toCharArray(): string[];
10
+
11
+ /**
12
+ * Encodes this String into a sequence of bytes using the named charset, storing the result into a new byte array.
13
+ * @param charsetName The name of a supported charset
14
+ * @returns The resultant byte array
15
+ * @throws UnsupportedEncodingException If the named charset is not supported
16
+ */
17
+ getBytes(charsetName: string): number[];
18
+
19
+ /**
20
+ * Encodes this String into a sequence of bytes using the platform's default charset, storing the result into a new byte array.
21
+ * @returns The resultant byte array
22
+ */
23
+ getBytes(): number[];
24
+
25
+ /**
26
+ * Returns the length of this string.
27
+ * @returns The length of the sequence of characters represented by this object.
28
+ */
29
+ length(): number;
30
+
31
+ /**
32
+ * Returns the char value at the specified index.
33
+ * @param index The index of the char value
34
+ * @returns The char value at the specified index of this string
35
+ * @throws StringIndexOutOfBoundsException If the index argument is negative or not less than the length of this string
36
+ */
37
+ charAt(index: number): string;
38
+
39
+ /**
40
+ * Returns a string that is a substring of this string.
41
+ * @param beginIndex The beginning index, inclusive
42
+ * @returns The specified substring
43
+ */
44
+ substring(beginIndex: number): String;
45
+
46
+ /**
47
+ * Returns a string that is a substring of this string.
48
+ * @param beginIndex The beginning index, inclusive
49
+ * @param endIndex The ending index, exclusive
50
+ * @returns The specified substring
51
+ */
52
+ substring(beginIndex: number, endIndex: number): String;
53
+
54
+ /**
55
+ * Compares this string to the specified object.
56
+ * @param anObject The object to compare this String against
57
+ * @returns true if the given object represents a String equivalent to this string, false otherwise
58
+ */
59
+ equals(anObject: any): boolean;
60
+
61
+ /**
62
+ * Compares this String to another String, ignoring case considerations.
63
+ * @param anotherString The String to compare this String against
64
+ * @returns true if the argument is not null and it represents an equivalent String ignoring case; false otherwise
65
+ */
66
+ equalsIgnoreCase(anotherString: String): boolean;
67
+
68
+ /**
69
+ * Returns a string representation of the object.
70
+ * @returns A string representation of the object
71
+ */
72
+ toString(): string;
4
73
  }
5
74
  }
@@ -0,0 +1,89 @@
1
+ declare namespace java.security {
2
+ export class MessageDigest {
3
+ /**
4
+ * Returns a MessageDigest object that implements the specified digest algorithm.
5
+ * @param algorithm The name of the algorithm requested (e.g., "MD5", "SHA-1", "SHA-256")
6
+ * @returns A MessageDigest object implementing the specified algorithm
7
+ * @throws NoSuchAlgorithmException if the algorithm is not available
8
+ */
9
+ static getInstance(algorithm: string): MessageDigest;
10
+
11
+ /**
12
+ * Updates the digest using the specified byte.
13
+ * @param input The byte with which to update the digest
14
+ */
15
+ update(input: number): void;
16
+
17
+ /**
18
+ * Updates the digest using the specified array of bytes.
19
+ * @param input The array of bytes with which to update the digest
20
+ */
21
+ update(input: number[]): void;
22
+
23
+ /**
24
+ * Updates the digest using the specified array of bytes, starting at the specified offset.
25
+ * @param input The array of bytes
26
+ * @param offset The offset to start from in the array of bytes
27
+ * @param len The number of bytes to use, starting at offset
28
+ */
29
+ update(input: number[], offset: number, len: number): void;
30
+
31
+ /**
32
+ * Updates the digest using the specified ByteBuffer.
33
+ * @param input The ByteBuffer with which to update the digest
34
+ */
35
+ update(input: any): void; // ByteBuffer type would be defined elsewhere
36
+
37
+ /**
38
+ * Completes the hash computation by performing final operations such as padding.
39
+ * @returns The array of bytes for the resulting hash value
40
+ */
41
+ digest(): number[];
42
+
43
+ /**
44
+ * Completes the hash computation by performing final operations such as padding.
45
+ * @param input The input to be padded before the final operations
46
+ * @returns The array of bytes for the resulting hash value
47
+ */
48
+ digest(input: number[]): number[];
49
+
50
+ /**
51
+ * Completes the hash computation by performing final operations such as padding.
52
+ * @param input The input to be padded before the final operations
53
+ * @param offset The offset to start from in the input array
54
+ * @param len The number of bytes to use, starting at offset
55
+ * @returns The array of bytes for the resulting hash value
56
+ */
57
+ digest(input: number[], offset: number, len: number): number[];
58
+
59
+ /**
60
+ * Returns a string that identifies the algorithm, independent of implementation details.
61
+ * @returns The name of the algorithm
62
+ */
63
+ getAlgorithm(): string;
64
+
65
+ /**
66
+ * Returns the length of the digest in bytes, or 0 if this operation is not supported.
67
+ * @returns The length of the digest in bytes, or 0 if this operation is not supported
68
+ */
69
+ getDigestLength(): number;
70
+
71
+ /**
72
+ * Resets the digest for further use.
73
+ */
74
+ reset(): void;
75
+
76
+ /**
77
+ * Returns a clone if the implementation is cloneable.
78
+ * @returns A clone if the implementation is cloneable
79
+ * @throws CloneNotSupportedException if the implementation is not cloneable
80
+ */
81
+ clone(): MessageDigest;
82
+
83
+ /**
84
+ * Returns a string representation of this message digest object.
85
+ * @returns A string representation of this object
86
+ */
87
+ toString(): string;
88
+ }
89
+ }
@@ -0,0 +1,13 @@
1
+ declare namespace java.security {
2
+ export class MessageDigester {
3
+ /**
4
+ * Returns the hash digest of a string using the specified algorithm.
5
+ * @param content The input string to hash
6
+ * @param algorithm The algorithm (e.g. "MD5", "SHA-1", "SHA-256")
7
+ * @returns The digest as a hex string
8
+ */
9
+ static digest(content: string, algorithm?: string): string;
10
+ // This is a type declaration file; implementation code is not allowed here.
11
+
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ declare namespace java.util {
2
+ namespace concurrent {
3
+ export enum TimeUnit {
4
+ NANOSECONDS = "NANOSECONDS",
5
+ MICROSECONDS = "MICROSECONDS",
6
+ MILLISECONDS = "MILLISECONDS",
7
+ SECONDS = "SECONDS",
8
+ MINUTES = "MINUTES",
9
+ HOURS = "HOURS",
10
+ DAYS = "DAYS"
11
+ }
12
+ }
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deafwave/osrs-botmaker-types",
3
- "version": "0.5.21",
3
+ "version": "0.6.0",
4
4
  "author": {
5
5
  "name": "Chandler Ferry",
6
6
  "url": "https://github.com/ChandlerFerry"