lapis-lazuli 0.1.0 → 0.2.2

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +24 -0
  2. package/package.json +6 -1
package/dist/index.d.ts CHANGED
@@ -420,6 +420,29 @@ export interface StorageService {
420
420
  plugin: KeyValueStore;
421
421
  files: FileStore;
422
422
  }
423
+ export interface HttpRequestInit {
424
+ method?: string;
425
+ headers?: Record<string, string>;
426
+ body?: string;
427
+ }
428
+ export interface HttpRequest {
429
+ url: string;
430
+ method?: string;
431
+ headers?: Record<string, string>;
432
+ body?: string;
433
+ }
434
+ export interface HttpResponse {
435
+ url: string;
436
+ status: number;
437
+ ok: boolean;
438
+ headers: Record<string, string>;
439
+ body: string;
440
+ text(): string;
441
+ }
442
+ export interface HttpService {
443
+ fetch(url: string, init?: HttpRequestInit): Promise<HttpResponse>;
444
+ fetch(request: HttpRequest): Promise<HttpResponse>;
445
+ }
423
446
  export interface UnsafeBridge {
424
447
  events: {
425
448
  onJava<T = unknown>(eventClassName: string, handler: (payload: T) => Awaitable<void>): HookHandle;
@@ -461,6 +484,7 @@ export interface PluginContext {
461
484
  bossBars: BossBarsService;
462
485
  scoreboards: ScoreboardsService;
463
486
  storage: StorageService;
487
+ http: HttpService;
464
488
  config: KeyValueStore;
465
489
  unsafe: UnsafeBridge;
466
490
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lapis-lazuli",
3
- "version": "0.1.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -13,6 +13,11 @@
13
13
  "files": [
14
14
  "dist"
15
15
  ],
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/metashiyun/lapis-lazuli.git",
19
+ "directory": "sdks/typescript"
20
+ },
16
21
  "publishConfig": {
17
22
  "access": "public"
18
23
  },