milkio 1.0.22 → 1.1.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.
@@ -2,7 +2,7 @@ import type { Mixin, GeneratedInit } from "../index.ts";
2
2
  import type { __initExecuter } from "../execute/index.ts";
3
3
  export type MilkioHttpRequest = Request;
4
4
  export type MilkioHttpResponse = Mixin<ResponseInit, {
5
- body: any;
5
+ body: string | ReadableStream<Uint8Array> | Uint8Array | ArrayBuffer | Blob | null;
6
6
  status: number;
7
7
  headers: Record<string, string>;
8
8
  }>;
@@ -13,6 +13,7 @@ export declare function __initListener(generated: GeneratedInit, runtime: any, e
13
13
  envMode?: string;
14
14
  env?: Record<any, any>;
15
15
  routeSchema?: any;
16
+ rawResponse?: boolean;
16
17
  }) => Promise<Response>;
17
18
  handleMessage: (port: {
18
19
  postMessage(message: any): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "milkio",
3
- "version": "1.0.22",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "exports": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1 +1,3 @@
1
- export declare const __createId: () => string;
1
+ declare function __createFastId(): string;
2
+ export declare const __createId: typeof __createFastId;
3
+ export {};
package/utils/trie.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  export declare class Trie<T> {
2
2
  private root;
3
+ private cache;
3
4
  constructor();
4
5
  add(path: string, value: T): void;
5
6
  get(path: string): T | null;
7
+ getByParts(parts: string[]): T | null;
6
8
  has(path: string): boolean;
7
9
  }
package/world/index.d.ts CHANGED
@@ -28,6 +28,8 @@ export type MilkioRuntimeInit<T extends MilkioInit> = Mixin<T, {
28
28
  emit: Awaited<ReturnType<typeof __initEventManager>>["emit"];
29
29
  emitAnyApproved: Awaited<ReturnType<typeof __initEventManager>>["emitAnyApproved"];
30
30
  emitAllApproved: Awaited<ReturnType<typeof __initEventManager>>["emitAllApproved"];
31
+ _hasEmitHandlers: Awaited<ReturnType<typeof __initEventManager>>["_hasEmitHandlers"];
32
+ _emitHandlersVersion: number;
31
33
  }>;
32
34
  export declare function createWorld<MilkioOptions extends MilkioInit>(generated: GeneratedInit, configSchema: {
33
35
  get: () => Promise<Record<any, any>>;
@@ -1 +0,0 @@
1
- export declare function reviveJSONParse<T>(json: T): T;