Skip to content

Commit f925c01

Browse files
style(Common): Reformat TypeScript declaration files for Workers API
Reformat TypeScript .d.ts declaration files in TypeScript/Function/ and TypeScript/Interface/ to improve readability and consistency: - Add blank lines after import statements - Reformat multi-line type imports and function parameters with proper indentation - Fix missing newlines at end of files - Normalize whitespace in interface definitions No functional changes; purely cosmetic formatting improvements for the Cloudflare Workers API type declarations.
1 parent 8391731 commit f925c01

18 files changed

+166
-115
lines changed

TypeScript/Function/Access.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import type Interface from "../Interface/Access.js";
2+
23
/**
34
* @module Access
45
*
56
*/
67
declare const _default: Interface;
78
export default _default;
89
export declare const Uint8ArrayFromObject: import("../Interface/Uint8ArrayFromObject.js").default;
9-
//# sourceMappingURL=Access.d.ts.map
10+
//# sourceMappingURL=Access.d.ts.map

TypeScript/Function/Decrypt.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import type Interface from "../Interface/Decrypt.js";
2+
23
/**
34
* @module Decrypt
45
*
56
*/
67
declare const _default: Interface;
78
export default _default;
8-
//# sourceMappingURL=Decrypt.d.ts.map
9+
//# sourceMappingURL=Decrypt.d.ts.map

TypeScript/Function/Encrypt.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import type Interface from "../Interface/Encrypt.js";
2+
23
/**
34
* @module Encrypt
45
*
56
*/
67
declare const _default: Interface;
78
export default _default;
8-
//# sourceMappingURL=Encrypt.d.ts.map
9+
//# sourceMappingURL=Encrypt.d.ts.map

TypeScript/Function/Get.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import type Interface from "../Interface/Get.js";
2+
23
/**
34
* @module Get
45
*
56
*/
67
declare const _default: Interface;
78
export default _default;
8-
//# sourceMappingURL=Get.d.ts.map
9+
//# sourceMappingURL=Get.d.ts.map

TypeScript/Function/Put.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import type Interface from "../Interface/Put.js";
2+
23
/**
34
* @module Put
45
*
56
*/
67
declare const _default: Interface;
78
export default _default;
8-
//# sourceMappingURL=Put.d.ts.map
9+
//# sourceMappingURL=Put.d.ts.map

TypeScript/Function/Redirect.d.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,29 @@
11
import type Interface from "../Interface/Redirect.js";
2+
23
/**
34
* @module Redirect
45
*
56
*/
67
declare const _default: Interface;
78
export default _default;
89
export declare const Response: {
9-
new (body?: import("@cloudflare/workers-types/experimental/index.js").BodyInit | null, init?: import("@cloudflare/workers-types/experimental/index.js").ResponseInit): import("@cloudflare/workers-types/experimental/index.js").Response;
10-
prototype: import("@cloudflare/workers-types/experimental/index.js").Response;
11-
error(): import("@cloudflare/workers-types/experimental/index.js").Response;
12-
redirect(url: string, status?: number): import("@cloudflare/workers-types/experimental/index.js").Response;
13-
json(any: any, maybeInit?: import("@cloudflare/workers-types/experimental/index.js").ResponseInit | import("@cloudflare/workers-types/experimental/index.js").Response): import("@cloudflare/workers-types/experimental/index.js").Response;
10+
new (
11+
body?:
12+
| import("@cloudflare/workers-types/experimental/index.js").BodyInit
13+
| null,
14+
init?: import("@cloudflare/workers-types/experimental/index.js").ResponseInit,
15+
): import("@cloudflare/workers-types/experimental/index.js").Response;
16+
prototype: import("@cloudflare/workers-types/experimental/index.js").Response;
17+
error(): import("@cloudflare/workers-types/experimental/index.js").Response;
18+
redirect(
19+
url: string,
20+
status?: number,
21+
): import("@cloudflare/workers-types/experimental/index.js").Response;
22+
json(
23+
any: any,
24+
maybeInit?:
25+
| import("@cloudflare/workers-types/experimental/index.js").ResponseInit
26+
| import("@cloudflare/workers-types/experimental/index.js").Response,
27+
): import("@cloudflare/workers-types/experimental/index.js").Response;
1428
};
15-
//# sourceMappingURL=Redirect.d.ts.map
29+
//# sourceMappingURL=Redirect.d.ts.map

TypeScript/Function/Response.d.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,29 @@
11
import type Interface from "../Interface/Response.js";
2+
23
/**
34
* @module Response
45
*
56
*/
67
declare const _default: Interface;
78
export default _default;
89
export declare const Response: {
9-
new (body?: import("@cloudflare/workers-types/experimental/index.js").BodyInit | null, init?: import("@cloudflare/workers-types/experimental/index.js").ResponseInit): import("@cloudflare/workers-types/experimental/index.js").Response;
10-
prototype: import("@cloudflare/workers-types/experimental/index.js").Response;
11-
error(): import("@cloudflare/workers-types/experimental/index.js").Response;
12-
redirect(url: string, status?: number): import("@cloudflare/workers-types/experimental/index.js").Response;
13-
json(any: any, maybeInit?: import("@cloudflare/workers-types/experimental/index.js").ResponseInit | import("@cloudflare/workers-types/experimental/index.js").Response): import("@cloudflare/workers-types/experimental/index.js").Response;
10+
new (
11+
body?:
12+
| import("@cloudflare/workers-types/experimental/index.js").BodyInit
13+
| null,
14+
init?: import("@cloudflare/workers-types/experimental/index.js").ResponseInit,
15+
): import("@cloudflare/workers-types/experimental/index.js").Response;
16+
prototype: import("@cloudflare/workers-types/experimental/index.js").Response;
17+
error(): import("@cloudflare/workers-types/experimental/index.js").Response;
18+
redirect(
19+
url: string,
20+
status?: number,
21+
): import("@cloudflare/workers-types/experimental/index.js").Response;
22+
json(
23+
any: any,
24+
maybeInit?:
25+
| import("@cloudflare/workers-types/experimental/index.js").ResponseInit
26+
| import("@cloudflare/workers-types/experimental/index.js").Response,
27+
): import("@cloudflare/workers-types/experimental/index.js").Response;
1428
};
15-
//# sourceMappingURL=Response.d.ts.map
29+
//# sourceMappingURL=Response.d.ts.map
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import type Interface from "../Interface/Uint8ArrayFromObject.js";
2+
23
/**
34
* @module Uint8ArrayFromObject
45
*
56
*/
67
declare const _default: Interface;
78
export default _default;
8-
//# sourceMappingURL=Uint8ArrayFromObject.d.ts.map
9+
//# sourceMappingURL=Uint8ArrayFromObject.d.ts.map

TypeScript/Interface/Access.d.ts

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,39 @@
1-
import type { JsonWebKey, KVNamespace } from "@cloudflare/workers-types/experimental/index.js";
1+
import type {
2+
JsonWebKey,
3+
KVNamespace,
4+
} from "@cloudflare/workers-types/experimental/index.js";
5+
26
/**
37
* @module Access
48
*
59
*/
610
export default interface Interface {
7-
/**
8-
* The function `Access` is a TypeScript function that decrypts and retrieves a specific
9-
* view from a stored data object using a provided key and unique identifier.
10-
*
11-
* @param Key - The `Key` parameter is of type `JsonWebKey["k"]`, which means it expects
12-
* a value that is a string representing a JSON Web Key. This key will be used for
13-
* decryption.
14-
*
15-
* @param Identifier - The Identifier parameter is a unique identifier generated using the
16-
* `randomUUID` function from the `Crypto` object. It is used to retrieve data from the
17-
* KV namespace.
18-
*
19-
* @param KV - KV is an instance of the KVNamespace class, which is used
20-
* to interact with the Workers KV storage. It provides methods for reading, writing,
21-
* and deleting data from the KV storage.
22-
*
23-
* @param View - The `View` parameter is a string that represents the specific
24-
* view or property of the decrypted data that you want to access. It is used to
25-
* retrieve a specific value from the decrypted data object.
26-
*
27-
*/
28-
(Key: JsonWebKey["k"], Identifier: ReturnType<Crypto["randomUUID"]>, KV: KVNamespace, View: string): unknown;
11+
/**
12+
* The function `Access` is a TypeScript function that decrypts and retrieves a specific
13+
* view from a stored data object using a provided key and unique identifier.
14+
*
15+
* @param Key - The `Key` parameter is of type `JsonWebKey["k"]`, which means it expects
16+
* a value that is a string representing a JSON Web Key. This key will be used for
17+
* decryption.
18+
*
19+
* @param Identifier - The Identifier parameter is a unique identifier generated using the
20+
* `randomUUID` function from the `Crypto` object. It is used to retrieve data from the
21+
* KV namespace.
22+
*
23+
* @param KV - KV is an instance of the KVNamespace class, which is used
24+
* to interact with the Workers KV storage. It provides methods for reading, writing,
25+
* and deleting data from the KV storage.
26+
*
27+
* @param View - The `View` parameter is a string that represents the specific
28+
* view or property of the decrypted data that you want to access. It is used to
29+
* retrieve a specific value from the decrypted data object.
30+
*
31+
*/
32+
(
33+
Key: JsonWebKey["k"],
34+
Identifier: ReturnType<Crypto["randomUUID"]>,
35+
KV: KVNamespace,
36+
View: string,
37+
): unknown;
2938
}
30-
//# sourceMappingURL=Access.d.ts.map
39+
//# sourceMappingURL=Access.d.ts.map

TypeScript/Interface/Data.d.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import type _Object from "./Object.js";
2+
23
/**
34
* @module Uint8ArrayObject
45
*
56
*/
67
export default interface Interface {
7-
Vector: _Object;
8-
Data: _Object;
8+
Vector: _Object;
9+
Data: _Object;
910
}
10-
//# sourceMappingURL=Data.d.ts.map
11+
//# sourceMappingURL=Data.d.ts.map

0 commit comments

Comments
 (0)