@openstax/ts-utils 1.27.3 → 1.27.5

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.
@@ -36,8 +36,13 @@ export declare type ApiClientResponse<Ro> = Ro extends any ? {
36
36
  status: TResponseStatus<Ro>;
37
37
  load: () => Promise<TResponsePayload<Ro>>;
38
38
  } : never;
39
+ export declare type ExpandRoute<T> = T extends ((...args: infer A) => infer R) & {
40
+ renderUrl: (...args: infer Ar) => Promise<string>;
41
+ } ? (...args: A) => R & {
42
+ renderUrl: (...args: Ar) => Promise<string>;
43
+ } : never;
39
44
  export declare type MapRoutesToClient<Ru> = [Ru] extends [AnyRoute<Ru>] ? {
40
- [N in Ru['name']]: RouteClient<Extract<Ru, Record<'name', N>>>;
45
+ [N in Ru['name']]: ExpandRoute<RouteClient<Extract<Ru, Record<'name', N>>>>;
41
46
  } : never;
42
47
  export declare type MapRoutesToConfig<Ru> = [Ru] extends [AnyRoute<Ru>] ? {
43
48
  [N in Ru['name']]: {
@@ -31,10 +31,6 @@ declare type Field = {
31
31
  } | {
32
32
  key: string;
33
33
  type: 'keyword';
34
- } | {
35
- key: string;
36
- type: 'date';
37
- format?: string;
38
34
  } | {
39
35
  key: string;
40
36
  type: 'boolean';
@@ -45,6 +41,9 @@ export interface IndexOptions<T> {
45
41
  }
46
42
  export declare type FieldMapping = {
47
43
  type: 'keyword' | 'text' | 'boolean';
44
+ } | {
45
+ type: 'date';
46
+ format?: string;
48
47
  } | {
49
48
  type?: 'nested' | 'object';
50
49
  properties: Record<string, FieldMapping>;