@milkio/astra 1.0.0-beta.61 → 1.0.0-beta.63

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 (3) hide show
  1. package/index.d.ts +4 -1
  2. package/index.js +6 -5
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -29,6 +29,9 @@ type Logger = {
29
29
  };
30
30
  type Log = [string, "[DEBUG]" | "[INFO]" | "[WARN]" | "[ERROR]" | "[RESPONSE]", string, string, ...Array<unknown>];
31
31
  type Reject = (description: string, ...params: Array<unknown>) => Error;
32
+ type DeepPartial<T> = T extends Function ? T : T extends object ? {
33
+ [P in keyof T]?: DeepPartial<T[P]>;
34
+ } : T;
32
35
  export declare function createAstra<AstraOptions extends AstraOptionsInit, Generated extends AstraOptions["stargate"]["$types"]["generated"]>(astraOptions: AstraOptions): Promise<{
33
36
  options: AstraOptions;
34
37
  createMirrorWorld(importMetaUrl: string): Promise<[Context, Reject, Mixin<Awaited<ReturnType<AstraOptions["bootstrap"]>>, {
@@ -40,7 +43,7 @@ export declare function createAstra<AstraOptions extends AstraOptionsInit, Gener
40
43
  execute: <Path extends keyof Generated["routeSchema"]>(path: Path, options?: Mixin<ExecuteOptions, {
41
44
  params?: Generated["routeSchema"][Path]["types"]["params"];
42
45
  } | {
43
- params?: Partial<Generated["routeSchema"][Path]["types"]["params"]>;
46
+ params?: DeepPartial<Generated["routeSchema"][Path]["types"]["params"]>;
44
47
  generateParams: true;
45
48
  }>) => Promise<Generated["routeSchema"][Path]["types"]["\uD83D\uDC23"] extends boolean ? // action
46
49
  [Partial<Generated["rejectCode"]>, null, ExecuteResultsOption] | [null, Generated["routeSchema"][Path]["types"]["result"], ExecuteResultsOption] : // stream